Skip to content

Commit

Permalink
feat: give invited users the "invited" status
Browse files Browse the repository at this point in the history
  • Loading branch information
ojeytonwilliams committed Nov 22, 2023
1 parent 7613fdb commit cf23eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = (plugin) => {
data: {
provider: "auth0",
password: null,
status: "invited",
},
});

Expand Down
5 changes: 3 additions & 2 deletions apps/backend/tests/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("auth", () => {
jest.clearAllMocks();
});

it("should set the user's provider to auth0 and delete the password", async () => {
it('should modify the user object into the "invited" state', async () => {
// There are subtle differences between what services.user.add and
// getUser return, so we use getUser for a fair comparison.
const user = await getUser(mockUserData.username);
Expand All @@ -52,11 +52,12 @@ describe("auth", () => {
expect(res.body).toEqual({ status: "success" });
expect(res.status).toEqual(200);
const updatedUser = await getUser(user.username);
expect(updatedUser).toEqual({
expect(updatedUser).toMatchObject({
...user,
provider: "auth0",
updatedAt: updatedUser.updatedAt,
password: null,
status: "invited",
});
});

Expand Down

0 comments on commit cf23eab

Please sign in to comment.