(t *testing.T)
| 725 | } |
| 726 | |
| 727 | func TestNotificationTemplates_Golden(t *testing.T) { |
| 728 | t.Parallel() |
| 729 | |
| 730 | const ( |
| 731 | username = "bob" |
| 732 | password = "🤫" |
| 733 | |
| 734 | hello = "localhost" |
| 735 | |
| 736 | from = "system@coder.com" |
| 737 | hint = "run \"make gen/golden-files\" and commit the changes" |
| 738 | ) |
| 739 | |
| 740 | tests := []struct { |
| 741 | name string |
| 742 | id uuid.UUID |
| 743 | payload types.MessagePayload |
| 744 | |
| 745 | appName string |
| 746 | logoURL string |
| 747 | }{ |
| 748 | { |
| 749 | name: "TemplateWorkspaceDeleted", |
| 750 | id: notifications.TemplateWorkspaceDeleted, |
| 751 | payload: types.MessagePayload{ |
| 752 | UserName: "Bobby", |
| 753 | UserEmail: "bobby@coder.com", |
| 754 | UserUsername: "bobby", |
| 755 | Labels: map[string]string{ |
| 756 | "name": "bobby-workspace", |
| 757 | "reason": "autodeleted due to dormancy", |
| 758 | "initiator": "autobuild", |
| 759 | }, |
| 760 | Targets: []uuid.UUID{ |
| 761 | uuid.MustParse("5c6ea841-ca63-46cc-9c37-78734c7a788b"), |
| 762 | uuid.MustParse("b8355e3a-f3c5-4dd1-b382-7eb1fae7db52"), |
| 763 | }, |
| 764 | }, |
| 765 | }, |
| 766 | { |
| 767 | name: "TemplateWorkspaceAutobuildFailed", |
| 768 | id: notifications.TemplateWorkspaceAutobuildFailed, |
| 769 | payload: types.MessagePayload{ |
| 770 | UserName: "Bobby", |
| 771 | UserEmail: "bobby@coder.com", |
| 772 | UserUsername: "bobby", |
| 773 | Labels: map[string]string{ |
| 774 | "name": "bobby-workspace", |
| 775 | "reason": "autostart", |
| 776 | }, |
| 777 | Targets: []uuid.UUID{ |
| 778 | uuid.MustParse("5c6ea841-ca63-46cc-9c37-78734c7a788b"), |
| 779 | uuid.MustParse("b8355e3a-f3c5-4dd1-b382-7eb1fae7db52"), |
| 780 | }, |
| 781 | }, |
| 782 | }, |
| 783 | { |
| 784 | name: "TemplateWorkspaceDormant", |
nothing calls this directly
no test coverage detected