Fix test
This commit is contained in:
parent
b0a12e034d
commit
fe0ac28851
|
@ -24,7 +24,7 @@ describe("auth", () => {
|
||||||
])(
|
])(
|
||||||
`can use passwords up to ${PASSWORD_MAX_LENGTH} characters in length`,
|
`can use passwords up to ${PASSWORD_MAX_LENGTH} characters in length`,
|
||||||
password => {
|
password => {
|
||||||
expect(validatePassword(password as string)).toEqual({
|
expect(validatePassword(password)).toEqual({
|
||||||
valid: true,
|
valid: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -32,12 +32,18 @@ describe("auth", () => {
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
generator.word({ length: PASSWORD_MAX_LENGTH + 1 }),
|
generator.word({ length: PASSWORD_MAX_LENGTH + 1 }),
|
||||||
generator.paragraph().substring(0, PASSWORD_MAX_LENGTH + 1),
|
generator
|
||||||
])("limit password length", password => {
|
.paragraph({ sentences: 50 })
|
||||||
expect(validatePassword(password as string)).toEqual({
|
.substring(0, PASSWORD_MAX_LENGTH + 1),
|
||||||
valid: false,
|
])(
|
||||||
error: "Password invalid. Maximum 512 characters.",
|
`passwords cannot have more than ${PASSWORD_MAX_LENGTH} characters`,
|
||||||
})
|
password => {
|
||||||
})
|
console.error(password)
|
||||||
|
expect(validatePassword(password)).toEqual({
|
||||||
|
valid: false,
|
||||||
|
error: "Password invalid. Maximum 512 characters.",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue