Skip to content

Commit e04a7e6

Browse files
committed
fix
1 parent a08f9df commit e04a7e6

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
@@ -1181,6 +1181,22 @@ describe("UserDal", () => {
11811181
expect(read.email).toEqual("next");
11821182
expect(read.emailVerified).toEqual(false);
11831183
});
1184+
1185+
it("should update email and isVerified", async () => {
1186+
//given
1187+
const { uid } = await UserTestData.createUser({
1188+
email: "init",
1189+
emailVerified: false,
1190+
});
1191+
1192+
//when
1193+
await expect(UserDAL.updateEmail(uid, "next", true)).resolves.toBe(true);
1194+
1195+
//then
1196+
const read = await UserDAL.getUser(uid, "read");
1197+
expect(read.email).toEqual("next");
1198+
expect(read.emailVerified).toEqual(true);
1199+
});
11841200
});
11851201
describe("resetPb", () => {
11861202
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
@@ -233,7 +233,7 @@ export async function updateQuoteRatings(
233233
export async function updateEmail(
234234
uid: string,
235235
email: string,
236-
emailVerified: boolean = true
236+
emailVerified: boolean = false
237237
): Promise<boolean> {
238238
await updateUser(
239239
{ uid },

0 commit comments

Comments
 (0)