fix(e2e): address CTO review feedback on PR #101

- Fix route mismatch: mock /api/impersonation/sessions/session-1 (plural)
- Navigate to /?sessionId=session-1 so CustomerPortal fetches session
- Replace .bg-amber-500 with data-testid="impersonation-banner"
- Remove waitForTimeout(1100), use proper waitFor
- Fix locale-dependent time regex in "banner shows started time" test
- Fix loading state race by waiting for response before fulfilling
- Add data-testid to ImpersonationBanner component
- Add trailing newlines to both spec files

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Lint Roller
2026-03-22 11:36:07 +00:00
parent a466053000
commit 355f11fdaa
3 changed files with 24 additions and 20 deletions
+6 -1
View File
@@ -14,6 +14,11 @@ test.describe("DevLoginSelector", () => {
});
test("shows loading state while fetching users", async ({ page }) => {
await page.route("**/api/dev/users", async (route) => {
await page.waitForResponse((res) => res.url().includes("/api/dev/users"));
await new Promise((r) => setTimeout(r, 100));
await route.fulfill({ json: { staff: [], clients: [] } });
});
await page.goto("/login");
await expect(page.getByText("Loading users...")).toBeVisible();
});
@@ -66,4 +71,4 @@ test.describe("DevLoginSelector", () => {
await expect(page.getByText("Staff")).toBeVisible();
await expect(page.getByText("Clients")).toBeVisible();
});
});
});