-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: email is set as expired when email is not a beta.gouv.fr address (…
…#654) * fix: eamil is set as expired when email is not a beta.gouv.fr address * test: fix setEmailExpired relative test
- Loading branch information
1 parent
192ed03
commit 820a29d
Showing
2 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,9 +409,7 @@ describe("After quitting", () => { | |
should.equal(test.length, 2); | ||
}); | ||
|
||
it("should set email as expired", async () => { | ||
const today = new Date(fakeTodayDate); | ||
|
||
it("should set email as expired if email is not from main domain", async () => { | ||
const updatedUser = await db | ||
.updateTable("users") | ||
.where("username", "=", "julien.dauphant") | ||
|
@@ -436,7 +434,23 @@ describe("After quitting", () => { | |
.selectAll() | ||
.where("username", "=", "julien.dauphant") | ||
.execute(); | ||
user.primary_email_status.should.equal(EmailStatusCode.EMAIL_EXPIRED); | ||
user.primary_email_status.should.equal(EmailStatusCode.EMAIL_SUSPENDED); | ||
|
||
const updatedUser2 = await db | ||
.updateTable("users") | ||
.where("username", "=", "julien.dauphant") | ||
.set({ | ||
primary_email: `[email protected]`, | ||
}) | ||
.returningAll() | ||
.executeTakeFirstOrThrow(); | ||
await setEmailExpired(); | ||
const [user2] = await db | ||
.selectFrom("users") | ||
.selectAll() | ||
.where("username", "=", "julien.dauphant") | ||
.execute(); | ||
user2.primary_email_status.should.equal(EmailStatusCode.EMAIL_EXPIRED); | ||
// userinfos.restore(); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters