diff --git a/backend/__tests__/dal/user.spec.ts b/backend/__tests__/dal/user.spec.ts index aa75bdeff..992e9737b 100644 --- a/backend/__tests__/dal/user.spec.ts +++ b/backend/__tests__/dal/user.spec.ts @@ -1181,6 +1181,22 @@ describe("UserDal", () => { expect(read.email).toEqual("next"); expect(read.emailVerified).toEqual(false); }); + + it("should update email and isVerified", async () => { + //given + const { uid } = await UserTestData.createUser({ + email: "init", + emailVerified: false, + }); + + //when + await expect(UserDAL.updateEmail(uid, "next", true)).resolves.toBe(true); + + //then + const read = await UserDAL.getUser(uid, "read"); + expect(read.email).toEqual("next"); + expect(read.emailVerified).toEqual(true); + }); }); describe("resetPb", () => { it("throws for nonexisting user", async () => { diff --git a/backend/src/dal/user.ts b/backend/src/dal/user.ts index a2bb9cc20..3f91417d6 100644 --- a/backend/src/dal/user.ts +++ b/backend/src/dal/user.ts @@ -233,7 +233,7 @@ export async function updateQuoteRatings( export async function updateEmail( uid: string, email: string, - emailVerified: boolean = true + emailVerified: boolean = false ): Promise { await updateUser( { uid },