diff --git a/apps/e2e/tests/navigation.spec.ts b/apps/e2e/tests/navigation.spec.ts index 29a7060..2809afa 100644 --- a/apps/e2e/tests/navigation.spec.ts +++ b/apps/e2e/tests/navigation.spec.ts @@ -47,6 +47,11 @@ test.beforeEach(async ({ page }) => { if (url.includes("/api/invoices")) { return route.fulfill({ json: { data: [], total: 0 } }); } + if (url.includes("/api/invoices/stats/summary")) { + return route.fulfill({ + json: { revenueThisMonth: 0, outstanding: 0, refundsThisMonth: 0, methodBreakdown: [] }, + }); + } // Appointments, clients, services, staff, book, etc. return route.fulfill({ json: [] }); }); diff --git a/apps/e2e/tests/portal-data.spec.ts b/apps/e2e/tests/portal-data.spec.ts index 5e9b2ed..26ce82c 100644 --- a/apps/e2e/tests/portal-data.spec.ts +++ b/apps/e2e/tests/portal-data.spec.ts @@ -72,9 +72,15 @@ test.describe("Portal Data Integrity", () => { }); test("billing section renders without JS errors", async ({ page }) => { - // Mock billing endpoint - await page.route("**/api/billing**", (route) => - route.fulfill({ json: { invoices: [], balanceCents: 0 } }) + // Mock portal billing endpoints + await page.route("**/api/portal/config**", (route) => + route.fulfill({ json: { stripePublishableKey: "" } }) + ); + await page.route("**/api/portal/invoices**", (route) => + route.fulfill({ json: [] }) + ); + await page.route("**/api/portal/payment-methods**", (route) => + route.fulfill({ json: [] }) ); const consoleErrors: string[] = [];