This commit is contained in:
Christian Fehmer 2025-07-10 19:01:29 +02:00
parent a08f9df52d
commit e04a7e66cf
No known key found for this signature in database
GPG key ID: FE53784A69964062
2 changed files with 17 additions and 1 deletions

View file

@ -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 () => {

View file

@ -233,7 +233,7 @@ export async function updateQuoteRatings(
export async function updateEmail(
uid: string,
email: string,
emailVerified: boolean = true
emailVerified: boolean = false
): Promise<boolean> {
await updateUser(
{ uid },