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:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user