feat: notify on workspace creation (#15934)

This commit is contained in:
Danielle Maywood
2024-12-20 13:53:10 +00:00
committed by GitHub
parent f5d3f713c6
commit f0e81ab455
10 changed files with 291 additions and 14 deletions

View File

@ -274,7 +274,7 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
}
if tc.expectNotification {
sent := enqueuer.Sent()
sent := enqueuer.Sent(notificationstest.WithTemplateID(notifications.TemplateWorkspaceAutoUpdated))
require.Len(t, sent, 1)
require.Equal(t, sent[0].UserID, workspace.OwnerID)
require.Contains(t, sent[0].Targets, workspace.TemplateID)
@ -285,7 +285,8 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
require.Equal(t, "autobuild", sent[0].Labels["initiator"])
require.Equal(t, "autostart", sent[0].Labels["reason"])
} else {
require.Empty(t, enqueuer.Sent())
sent := enqueuer.Sent(notificationstest.WithTemplateID(notifications.TemplateWorkspaceAutoUpdated))
require.Empty(t, sent)
}
})
}