mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-13 19:04:06 +08:00
fix
This commit is contained in:
parent
a08f9df52d
commit
e04a7e66cf
2 changed files with 17 additions and 1 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue