fix(E2E): add missing API mocks for invoices stats and portal billing
navigation.spec.ts:
- Add mock for /api/invoices/stats/summary returning the shape
{ revenueThisMonth, outstanding, refundsThisMonth, methodBreakdown }
that InvoicesPage useEffect fetches on mount
portal-data.spec.ts billing test:
- Replace incorrect /api/billing** mock with correct portal endpoint
mocks: /api/portal/config, /api/portal/invoices, /api/portal/payment-methods
These are the actual endpoints BillingPayments component calls
Both fixes address the E2E failures reported by Lint Roller on PR #348.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -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: [] });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user