MCPcopy Index your code
hub / github.com/coder/coder / TestNotificationTemplates_Golden

Function TestNotificationTemplates_Golden

coderd/notifications/notifications_test.go:727–1745  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

725}
726
727func 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",

Callers

nothing calls this directly

Calls 15

RunMethod · 0.95
EnqueueWithDataMethod · 0.95
LastMessageMethod · 0.95
StopMethod · 0.95
NewWithAPIFunction · 0.92
CreateFirstUserFunction · 0.92
RoleUserAdminFunction · 0.92
AsNotifierFunction · 0.92
ContextFunction · 0.92
NewDBFunction · 0.92
NewBackendFunction · 0.92

Tested by

no test coverage detected