(t *testing.T)
| 1712 | } |
| 1713 | |
| 1714 | func TestActivateDormantUser(t *testing.T) { |
| 1715 | t.Parallel() |
| 1716 | client := coderdtest.New(t, nil) |
| 1717 | |
| 1718 | // Create users |
| 1719 | me := coderdtest.CreateFirstUser(t, client) |
| 1720 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 1721 | defer cancel() |
| 1722 | anotherUser, err := client.CreateUserWithOrgs(ctx, codersdk.CreateUserRequestWithOrgs{ |
| 1723 | Email: "coder@coder.com", |
| 1724 | Username: "coder", |
| 1725 | Password: "SomeStrongPassword!", |
| 1726 | OrganizationIDs: []uuid.UUID{me.OrganizationID}, |
| 1727 | }) |
| 1728 | require.NoError(t, err) |
| 1729 | |
| 1730 | // Ensure that new user has dormant account |
| 1731 | require.Equal(t, codersdk.UserStatusDormant, anotherUser.Status) |
| 1732 | |
| 1733 | // Activate user account |
| 1734 | _, err = client.UpdateUserStatus(ctx, anotherUser.Username, codersdk.UserStatusActive) |
| 1735 | require.NoError(t, err) |
| 1736 | |
| 1737 | // Verify if the account is active now |
| 1738 | anotherUser, err = client.User(ctx, anotherUser.Username) |
| 1739 | require.NoError(t, err) |
| 1740 | require.Equal(t, codersdk.UserStatusActive, anotherUser.Status) |
| 1741 | } |
| 1742 | |
| 1743 | func TestGetUser(t *testing.T) { |
| 1744 | t.Parallel() |
nothing calls this directly
no test coverage detected