fix(e2e): add /api/invoices/stats/summary mock (GRO-820) #347

Closed
groombook-engineer[bot] wants to merge 1 commits from fix/gro-820-e2e-invoices-mock into dev
+11
View File
@@ -44,6 +44,17 @@ test.beforeEach(async ({ page }) => {
json: { newClients: [], activeInPeriodCount: 0, churnRisk: [], churnRiskTotal: 0 },
});
}
// Specific route must come before /api/invoices to avoid intercepting stats/summary
if (url.includes("/api/invoices/stats/summary")) {
return route.fulfill({
json: {
revenueThisMonth: 0,
outstanding: 0,
refundsThisMonth: 0,
methodBreakdown: [],
},
});
}
if (url.includes("/api/invoices")) {
return route.fulfill({ json: { data: [], total: 0 } });
}