From 958f01262ba92633310810e264b70cfa72d6f557 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 19 Apr 2021 11:11:52 -0700 Subject: [PATCH] refactor: check errorMessage in login e2e test --- test/e2e/login.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e/login.test.ts b/test/e2e/login.test.ts index d82b20750..daefd2e3a 100644 --- a/test/e2e/login.test.ts +++ b/test/e2e/login.test.ts @@ -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!"))