mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-08 08:34:20 +02:00
Fixes login email test
This commit is contained in:
parent
f952e24884
commit
acdae94b31
@ -27,11 +27,11 @@ describe("signIn with", () => {
|
||||
})
|
||||
|
||||
it("invalid password length", async () => {
|
||||
await expect(signIn("my.email@gmail.com", "11011")).rejects.toThrow("Mot de passe invalid")
|
||||
await expect(signIn("my.email@gmail.com", "123")).rejects.toThrow("Mot de passe trop court")
|
||||
})
|
||||
|
||||
it("empty password", async () => {
|
||||
await expect(signIn("my.email@gmail.com", " ")).rejects.toThrow("Mot de passe invalid")
|
||||
await expect(signIn("my.email@gmail.com", " ")).rejects.toThrow("Mot de passe nécessaire")
|
||||
})
|
||||
|
||||
it("wrong password", async () => {
|
||||
|
@ -32,8 +32,11 @@ export async function signIn(rawEmail: string, rawPassword: string): Promise<Mem
|
||||
}
|
||||
|
||||
const password = rawPassword.replace(/^\s*/, "").replace(/\s*$/, "")
|
||||
if (password.length === 0) {
|
||||
throw Error("Mot de passe nécessaire")
|
||||
}
|
||||
if (password.length < passwordMinLength) {
|
||||
throw Error("Mot de passe invalid")
|
||||
throw Error("Mot de passe trop court")
|
||||
}
|
||||
|
||||
const membres: Membre[] = await listGet()
|
||||
|
Loading…
x
Reference in New Issue
Block a user