mirror of
https://github.com/danog/code-server.git
synced 2024-11-30 04:39:46 +01:00
refactor: check errorMessage in login e2e test
This commit is contained in:
parent
a3f18d6158
commit
958f01262b
@ -54,12 +54,16 @@ test.describe("login", () => {
|
||||
// The current RateLimiter allows 2 logins per minute plus
|
||||
// 12 logins per hour for a total of 14
|
||||
// See: src/node/routes/login.ts
|
||||
for (let i = 1; i <= 14; i++) {
|
||||
for (let i = 1; i <= 13; i++) {
|
||||
await page.click(".submit")
|
||||
await page.waitForLoadState("networkidle")
|
||||
// We double-check that the correct error message shows
|
||||
// which should be for incorrect password
|
||||
expect(await page.isVisible("text=Incorrect password"))
|
||||
}
|
||||
|
||||
// The 15th should fail
|
||||
// The 15th should fail for a different reason:
|
||||
// login rate
|
||||
await page.click(".submit")
|
||||
await page.waitForLoadState("networkidle")
|
||||
expect(await page.isVisible("text=Login rate limited!"))
|
||||
|
Loading…
Reference in New Issue
Block a user