Testing Checklist
Use This When
Use this page when adding automated tests or preparing a release branch.
What You Will Build
You will verify the integration with tests that cover the product states a regulated frontend depends on.
What Must Already Be True
- The target repository has a test runner or component testing strategy.
- API calls are routed through the shared client.
- External API calls can be mocked or tested against a controlled environment.
Test Contract
Run the target repository’s actual commands. Prefer:
pnpm typecheck
pnpm lint
pnpm test
pnpm build
If the repository uses npm, yarn, bun, or another tool, use that instead.
Minimum Verification Scenarios
- Public health endpoint renders reachable state.
- Public readiness endpoint renders ready or degraded state.
- Protected request without token redirects or shows sign-in state.
- Quick screening form validates missing or short name.
- Quick screening success renders evidence and limitations.
- API validation error maps to form error.
- API 401 maps to auth recovery.
- API 409 maps to conflict UI.
- Case creation success routes to case workspace.
- Section save updates UI without losing unsaved form state.
- Report generation shows
HITorMISScache status. - Workflow polling merges events without duplicates.
- Review decision requires rationale.
- Customer route does not render compliance-only fields.
Implementation Steps
- Add unit tests for API client error parsing.
- Add component tests for form validation and error rendering.
- Add route or integration tests for diagnostics and auth recovery.
- Add workflow tests for case creation, section save, report generation, and review decision.
- Add customer-route tests that assert restricted fields are absent.
Checkpoint
- The happy path and the main failure paths are covered.
- Tests assert visible product behavior, not only function calls.
- Test fixtures do not contain real customer data or secrets.
Common Mistakes
- Mocking the API client so heavily that error parsing is never tested.
- Testing only the success path.
- Forgetting customer-safe report assertions.
- Leaving real regulated payloads in snapshots or fixtures.