Skip to content

Commit 935b999

Browse files
committed
fix
1 parent 5ddc24a commit 935b999

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

backend/__tests__/dal/user.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,22 @@ describe("UserDal", () => {
11841184
expect(read.email).toEqual("next");
11851185
expect(read.emailVerified).toEqual(false);
11861186
});
1187+
1188+
it("should update email and isVerified", async () => {
1189+
//given
1190+
const { uid } = await UserTestData.createUser({
1191+
email: "init",
1192+
emailVerified: false,
1193+
});
1194+
1195+
//when
1196+
await expect(UserDAL.updateEmail(uid, "next", true)).resolves.toBe(true);
1197+
1198+
//then
1199+
const read = await UserDAL.getUser(uid, "read");
1200+
expect(read.email).toEqual("next");
1201+
expect(read.emailVerified).toEqual(true);
1202+
});
11871203
});
11881204
describe("resetPb", () => {
11891205
it("throws for nonexisting user", async () => {

backend/src/dal/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export async function updateQuoteRatings(
236236
export async function updateEmail(
237237
uid: string,
238238
email: string,
239-
emailVerified: boolean = true
239+
emailVerified: boolean = false
240240
): Promise<boolean> {
241241
await updateUser(
242242
{ uid },

0 commit comments

Comments
 (0)