From d95a2ede3625feb0fc474bcf2d4ece942a93b1fd Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Sat, 11 Apr 2026 15:42:56 +0000 Subject: [PATCH] fix(e2e): add paginated mock for /api/invoices and remove fragile networkidle wait - Return { data: [], total: 0 } for /api/invoices instead of falling through to generic [] - Removes waitForLoadState('networkidle') from admin invoices test (fragile in CI) - Fixes GRO-558 --- apps/e2e/tests/navigation.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/e2e/tests/navigation.spec.ts b/apps/e2e/tests/navigation.spec.ts index 054b9c6..8ba228c 100644 --- a/apps/e2e/tests/navigation.spec.ts +++ b/apps/e2e/tests/navigation.spec.ts @@ -44,7 +44,10 @@ test.beforeEach(async ({ page }) => { json: { newClients: [], activeInPeriodCount: 0, churnRisk: [], churnRiskTotal: 0 }, }); } - // Appointments, clients, services, staff, invoices, book, etc. + if (url.includes("/api/invoices")) { + return route.fulfill({ json: { data: [], total: 0 } }); + } + // Appointments, clients, services, staff, book, etc. return route.fulfill({ json: [] }); }); }); @@ -82,7 +85,6 @@ test("admin staff page loads", async ({ page }) => { test("admin invoices page loads", async ({ page }) => { await page.goto("/admin/invoices"); - await page.waitForLoadState("networkidle"); await expect(page.getByText("GroomBook")).toBeVisible(); await expect(page.getByRole("link", { name: "Invoices" })).toBeVisible(); });