Skip to content

Commit 736a2d7

Browse files
committed
make fmt and lint
1 parent 1ebc7f4 commit 736a2d7

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

coderd/inboxnotifications_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,17 @@ func TestInboxNotification_Watch(t *testing.T) {
167167

168168
dispatchFunc(ctx, uuid.New())
169169

170+
_, message, err := wsConn.Read(ctx)
171+
require.NoError(t, err)
172+
173+
var notif codersdk.GetInboxNotificationResponse
174+
err = json.Unmarshal(message, &notif)
175+
require.NoError(t, err)
176+
177+
require.Equal(t, 1, notif.UnreadCount)
178+
require.Equal(t, memberClient.ID, notif.Notification.UserID)
179+
require.Equal(t, "memory related title", notif.Notification.Title)
180+
170181
dispatchFunc, err = inboxHandler.Dispatcher(types.MessagePayload{
171182
UserID: memberClient.ID.String(),
172183
NotificationTemplateID: notifications.TemplateWorkspaceOutOfDisk.String(),
@@ -183,17 +194,6 @@ func TestInboxNotification_Watch(t *testing.T) {
183194

184195
dispatchFunc(ctx, uuid.New())
185196

186-
_, message, err := wsConn.Read(ctx)
187-
require.NoError(t, err)
188-
189-
var notif codersdk.GetInboxNotificationResponse
190-
err = json.Unmarshal(message, &notif)
191-
require.NoError(t, err)
192-
193-
require.Equal(t, 3, notif.UnreadCount)
194-
require.Equal(t, memberClient.ID, notif.Notification.UserID)
195-
require.Equal(t, "memory related title", notif.Notification.Title)
196-
197197
_, message, err = wsConn.Read(ctx)
198198
require.NoError(t, err)
199199

@@ -249,6 +249,17 @@ func TestInboxNotification_Watch(t *testing.T) {
249249

250250
dispatchFunc(ctx, uuid.New())
251251

252+
_, message, err := wsConn.Read(ctx)
253+
require.NoError(t, err)
254+
255+
var notif codersdk.GetInboxNotificationResponse
256+
err = json.Unmarshal(message, &notif)
257+
require.NoError(t, err)
258+
259+
require.Equal(t, 1, notif.UnreadCount)
260+
require.Equal(t, memberClient.ID, notif.Notification.UserID)
261+
require.Equal(t, "memory related title", notif.Notification.Title)
262+
252263
dispatchFunc, err = inboxHandler.Dispatcher(types.MessagePayload{
253264
UserID: memberClient.ID.String(),
254265
NotificationTemplateID: notifications.TemplateWorkspaceOutOfMemory.String(),
@@ -267,17 +278,6 @@ func TestInboxNotification_Watch(t *testing.T) {
267278

268279
dispatchFunc(ctx, uuid.New())
269280

270-
_, message, err := wsConn.Read(ctx)
271-
require.NoError(t, err)
272-
273-
var notif codersdk.GetInboxNotificationResponse
274-
err = json.Unmarshal(message, &notif)
275-
require.NoError(t, err)
276-
277-
require.Equal(t, 3, notif.UnreadCount)
278-
require.Equal(t, memberClient.ID, notif.Notification.UserID)
279-
require.Equal(t, "memory related title", notif.Notification.Title)
280-
281281
_, message, err = wsConn.Read(ctx)
282282
require.NoError(t, err)
283283

0 commit comments

Comments
 (0)