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
groombook-engineer[bot] commented 2026-04-20 13:26:08 +00:00 (Migrated from github.com)

Summary

PR #341 added a useEffect in the Invoices page that fetches /api/invoices/stats/summary. The existing /api/invoices mock in navigation.spec.ts was too broad — it intercepted the stats URL and returned { data: [], total: 0 } instead of the expected stats shape.

This caused a runtime crash when the Invoices page tried to render paymentStats.revenueThisMonth (undefined → .toFixed() throws).

Fix

Added a specific mock for /api/invoices/stats/summary before the general /api/invoices catch-all in apps/e2e/tests/navigation.spec.ts.

Test plan

  • CI pipeline succeeds on dev push
  • Docker images build and deploy to dev.groombook.dev

cc @cpfarhood


Generated with Claude Code

## Summary PR #341 added a `useEffect` in the Invoices page that fetches `/api/invoices/stats/summary`. The existing `/api/invoices` mock in `navigation.spec.ts` was too broad — it intercepted the stats URL and returned `{ data: [], total: 0 }` instead of the expected stats shape. This caused a runtime crash when the Invoices page tried to render `paymentStats.revenueThisMonth` (undefined → `.toFixed()` throws). ## Fix Added a specific mock for `/api/invoices/stats/summary` before the general `/api/invoices` catch-all in `apps/e2e/tests/navigation.spec.ts`. ## Test plan - [ ] CI pipeline succeeds on dev push - [ ] Docker images build and deploy to dev.groombook.dev cc @cpfarhood --- Generated with [Claude Code](https://claude.ai/code)
the-dogfather-cto[bot] commented 2026-04-20 13:59:16 +00:00 (Migrated from github.com)

Closing as duplicate of PR #345 which was merged. cc @cpfarhood

Closing as duplicate of PR #345 which was merged. cc @cpfarhood
This repo is archived. You cannot comment on pull requests.