Skip to content

Commit 6bc1d2d

Browse files
committed
fix test
1 parent e356ba8 commit 6bc1d2d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

coderd/users.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1310,9 +1310,9 @@ func (api *API) CreateUser(ctx context.Context, store database.Store, req Create
13101310
for _, u := range append(owners, userAdmins...) {
13111311
if _, err := api.NotificationsEnqueuer.Enqueue(ctx, u.ID, notifications.TemplateUserAccountCreated,
13121312
map[string]string{
1313-
"user_account_name": user.Name,
1313+
"user_account_name": user.Username,
13141314
}, "api-users-create",
1315-
u.ID,
1315+
user.ID,
13161316
); err != nil {
13171317
api.Logger.Warn(ctx, "unable to notify about created user", slog.F("created_user", user.Name), slog.Error(err))
13181318
}

coderd/users_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func TestNotifyCreatedUser(t *testing.T) {
628628
require.Len(t, notifyEnq.Sent, 1)
629629
require.Equal(t, notifications.TemplateUserAccountCreated, notifyEnq.Sent[0].TemplateID)
630630
require.Equal(t, firstUser.UserID, notifyEnq.Sent[0].UserID)
631-
require.Contains(t, user.ID, notifyEnq.Sent[0].Targets)
631+
require.Contains(t, notifyEnq.Sent[0].Targets, user.ID)
632632
require.Equal(t, user.Username, notifyEnq.Sent[0].Labels["user_account_name"])
633633
})
634634
}

0 commit comments

Comments
 (0)