Copy change

This commit is contained in:
Adria Navarro 2024-01-02 13:22:38 +01:00
parent 7bf7ca327f
commit 3b50d1a988
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,10 @@ export function validatePassword(
password: string password: string
): { valid: true } | { valid: false; error: string } { ): { valid: true } | { valid: false; error: string } {
if (!password || password.length < MIN_LENGTH) { if (!password || password.length < MIN_LENGTH) {
return { valid: false, error: "Password invalid. Minimum eight characters" } return {
valid: false,
error: "Password invalid. Minimum eight characters.",
}
} }
return { valid: true } return { valid: true }

View File

@ -13,7 +13,7 @@ describe("auth", () => {
])("%s returns unsuccessful", (_, password) => { ])("%s returns unsuccessful", (_, password) => {
expect(validatePassword(password as string)).toEqual({ expect(validatePassword(password as string)).toEqual({
valid: false, valid: false,
error: "Password invalid. Minimum eight characters", error: "Password invalid. Minimum eight characters.",
}) })
}) })
}) })