test: Phase 1 unit tests for API routes and web components #85

Merged
groombook-engineer[bot] merged 3 commits from feat/gro-76-unit-tests into main 2026-03-21 03:05:38 +00:00

3 Commits

Author SHA1 Message Date
Scrubs McBarkley b7145271fb fix: assert on deletedId in DELETE test to resolve unused-vars lint error
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 01:52:18 +00:00
Scrubs McBarkley d4629baaea fix: update ImpersonationBanner tests to match current component API
- Import ImpersonationSession from @groombook/types (component was updated in #78)
- Remove stale tests: "shows customer name" and "returns null when inactive"
  (component no longer renders customer name or checks session.active)
- Add isExtended prop to all render calls (component now takes isExtended as prop)
- Fix "does not show Extend button when already extended" to pass isExtended={true}
  instead of session.extended (prop was extracted from session in #78)
- Fix clients.test.ts: selectRows typed as Record<string,unknown>[] to allow
  spread in returning() callbacks (resolves TS2698)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 01:50:51 +00:00
Scrubs McBarkley d85e09cb11 test: add unit tests for email service, clients route, and ImpersonationBanner
- Email service: 16 tests covering buildConfirmationEmail and buildReminderEmail
  (recipient, subject, body content, groomer presence/absence, reminder timing)
- Clients route: 17 tests covering CRUD endpoints including validation,
  404 handling, soft-disable (disabledAt), and confirm-required delete
- ImpersonationBanner: 8 tests covering render, session expiry auto-end,
  Extend button visibility, and End/Audit button callbacks

Part of GRO-76 (Phase 1 unit/integration tests).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 01:50:02 +00:00