Services

Manager Mock Data


Manager mock data workflows

This note documents the focused manager mock-data verification surface. It does not claim repo-wide green status.

Mock mode#

Manager runs against deterministic in-memory mock APIs when VITE_USE_MOCK_API=true. The manager Playwright config sets this for pnpm e2e:manager in both dev-server and production-style modes.

Mock login personas are defined in packages/saas-api/src/mock.ts and surfaced on /login:

PersonaRoleEmailPasswordLanding route
John Doecustomerjohn@example.comcustomer123/dashboard
Jane Smithadminjane@example.comadmin123/admin

E2E route and action coverage#

Covered by e2e/manager/tests/auth.spec.ts, e2e/manager/tests/customer-dashboard.spec.ts, and e2e/manager/tests/admin.spec.ts.

Customer coverage signs in as John Doe and verifies populated mock-backed pages/actions:

  • /dashboard — customer summary and recent invoices.
  • /services — service cards backed by the customer's active subscriptions.
  • /subscriptions — existing subscriptions plus create and cancel subscription actions.
  • /subscriptions/$id — subscription details and related invoices.
  • /billing — invoice list plus pay invoice action.
  • /billing/$id — invoice detail page.
  • /user/settings — profile settings update.
  • /user/security — security form rendering.
  • /support — account-specific support snapshot.

Admin coverage signs in as Jane Smith and verifies populated mock-backed pages/actions:

  • /admin — admin dashboard and navigation.
  • /admin/subscriptions and /admin/subscriptions/$id — status filtering plus cancel subscription action.
  • /admin/invoices and /admin/invoices/$id — status filtering plus mark-paid action.
  • /admin/settings — platform settings update persistence in mock state.

Auth coverage verifies mock credential cards, direct mock sign-in buttons, invalid credential messaging, validation, role-aware redirects, and route protection for /dashboard and /admin.

Focused verification evidence#

Commands run from the repo root on 2026-04-30:

bash
1
mise run install
2
mise exec -- pnpm --filter @assistance/saas-api typecheck
3
mise exec -- pnpm --filter @assistance/saas-api test
4
mise exec -- pnpm --filter manager typecheck
5
mise exec -- pnpm --filter manager test
6
mise exec -- pnpm e2e:manager

Observed results:

  • mise run install completed successfully with pnpm 10.24.0.
  • @assistance/saas-api typecheck passed.
  • @assistance/saas-api tests passed: 1 test file, 17 tests.
  • manager typecheck passed.
  • manager tests passed: 10 test files, 47 tests.
  • pnpm e2e:manager passed: 14 Chromium Playwright tests.

Known command-surface note: packages/tsconfig/base.json uses ignoreDeprecations: "5.0" so the workspace TypeScript 5.9 compiler accepts the shared tsconfig during package typechecks.