Skip to content

Commit 1fa1271

Browse files
committed
feat(notifications): adapt tests with new labels
1 parent a42f108 commit 1fa1271

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

coderd/notifications/notifications_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ func TestWebhookDispatch(t *testing.T) {
241241

242242
// WHEN: a notification is enqueued (including arbitrary labels)
243243
input := map[string]string{
244-
"a": "b",
245-
"c": "d",
244+
"a": "b",
245+
"c": "d",
246+
"_logo_url": notifications.NotificationsDefaultLogoURL,
246247
}
247248
msgID, err := enq.Enqueue(ctx, user.ID, notifications.TemplateWorkspaceDeleted, input, "test")
248249
require.NoError(t, err)

coderd/notifications/notifier.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
const (
28-
notificationsDefaultLogoURL = "https://coder.com/coder-logo-horizontal.png"
28+
NotificationsDefaultLogoURL = "https://coder.com/coder-logo-horizontal.png"
2929
)
3030

3131
// notifier is a consumer of the notifications_messages queue. It dequeues messages from that table and processes them
@@ -236,7 +236,7 @@ func (n *notifier) prepare(ctx context.Context, msg database.AcquireNotification
236236

237237
if logoURL == "" {
238238
//nolint:ineffassign // define to default value if unable to fetch one from db
239-
logoURL = notificationsDefaultLogoURL
239+
logoURL = NotificationsDefaultLogoURL
240240
}
241241

242242
payload.Labels["_logo_url"] = logoURL

0 commit comments

Comments
 (0)