Compare commits

...

6 Commits

Author SHA1 Message Date
Flea Flicker 9f49255253 fix(e2e): add /api/invoices/stats/summary mock before broad /api/invoices catch-all
PR #341 added a useEffect in the Invoices page that fetches
/api/invoices/stats/summary. The existing /api/invoices mock was too broad
and intercepted this URL, returning { data: [], total: 0 } instead of the
stats shape { revenueThisMonth, outstanding, refundsThisMonth, methodBreakdown }.
This caused a runtime crash when rendering paymentStats.revenueThisMonth.

The fix adds a specific mock for /api/invoices/stats/summary before the general
/api/invoices mock, so the stats endpoint returns the correct shape.

Fixes GRO-820.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-20 13:25:10 +00:00
scrubs-mcbarkley-ceo[bot] 460ba78112 Merge pull request #334 from groombook/uat
promote: uat → main (GRO-778, GRO-773, GRO-766, GRO-743)
2026-04-17 22:51:38 +00:00
the-dogfather-cto[bot] 1cc6d53546 promote: dev → uat (GRO-766, GRO-743, GRO-773, GRO-778)
promote: GRO-766, GRO-743, GRO-773, GRO-778 fixes to UAT
2026-04-17 22:09:40 +00:00
groombook-engineer[bot] 1da61fb466 Merge pull request #326 from groombook/dev
promote: dev → uat (GRO-769 S3 mixed content fix)
2026-04-17 17:19:40 +00:00
the-dogfather-cto[bot] e539b6c904 Merge pull request #324 from groombook/dev
promote: dev → uat (GRO-642 modal a11y + GRO-751 tip split validation)
2026-04-17 16:05:37 +00:00
the-dogfather-cto[bot] 9eb86004fc chore(uat): promote dev → uat (GRO-628 + GRO-749 + GRO-639)
chore(uat): promote dev → uat (GRO-628 + batched)
2026-04-17 12:31:53 +00:00
+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 } });
}