Skip to content

Commit f4465d0

Browse files
committed
fix: fix tests
1 parent 39b1dfb commit f4465d0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

coderd/users_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,15 @@ func TestGetUsers(t *testing.T) {
353353
Password: "password",
354354
OrganizationID: user.OrganizationID,
355355
})
356-
suspendedUser, _ := client.CreateUser(context.Background(), codersdk.CreateUserRequest{
356+
client.CreateUser(context.Background(), codersdk.CreateUserRequest{
357357
Email: "bruno@email.com",
358358
Username: "bruno",
359359
Password: "password",
360360
OrganizationID: user.OrganizationID,
361361
})
362-
client.SuspendUser(context.Background(), suspendedUser.ID)
362+
client.SuspendUser(context.Background(), user.UserID)
363363
users, err := client.Users(context.Background(), codersdk.UsersRequest{
364-
Status: string(codersdk.UserStatusSuspended),
364+
Status: string(codersdk.UserStatusActive),
365365
})
366366
require.NoError(t, err)
367367
require.Len(t, users, 2)

codersdk/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func (c *Client) SuspendUser(ctx context.Context, userID uuid.UUID) (User, error
166166
if res.StatusCode != http.StatusOK {
167167
return User{}, readBodyAsError(res)
168168
}
169+
169170
var user User
170171
return user, json.NewDecoder(res.Body).Decode(&user)
171172
}

0 commit comments

Comments
 (0)