Skip to content

Commit 958f012

Browse files
committed
refactor: check errorMessage in login e2e test
1 parent a3f18d6 commit 958f012

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/e2e/login.test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ test.describe("login", () => {
5454
// The current RateLimiter allows 2 logins per minute plus
5555
// 12 logins per hour for a total of 14
5656
// See: src/node/routes/login.ts
57-
for (let i = 1; i <= 14; i++) {
57+
for (let i = 1; i <= 13; i++) {
5858
await page.click(".submit")
5959
await page.waitForLoadState("networkidle")
60+
// We double-check that the correct error message shows
61+
// which should be for incorrect password
62+
expect(await page.isVisible("text=Incorrect password"))
6063
}
6164

62-
// The 15th should fail
65+
// The 15th should fail for a different reason:
66+
// login rate
6367
await page.click(".submit")
6468
await page.waitForLoadState("networkidle")
6569
expect(await page.isVisible("text=Login rate limited!"))

0 commit comments

Comments
 (0)