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

1 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