Background
AGENTS.md mandates 90% test coverage for all code: "Ensure all code has corresponding tests. Ensure test coverage for each file is at least 90%." The Phase 1-5 component refactor explicitly deferred unit tests as out-of-scope, deferring the full coverage push to a single follow-up effort once the interface dust settled.
There is currently no Vitest config, no test runner, no test files in clients/web/. The root package.json has a placeholder "test": "echo \"Error: no test specified\" && exit 1". Coverage is effectively zero.
Scope
Test infrastructure:
Component tests (62 components):
Core module tests (under core/):
Acceptance criteria
Test plan
Out of scope
- E2E / browser tests (Playwright or similar) — would be a third tier.
- Storybook interaction tests — already exercised manually.
- Performance / load tests.
- Tests for the v2
core/ hook layer (its own tests live with the hook layer issue).
Independent of
- This effort can run in parallel with the v2 core hook layer effort. Tests for existing dumb components don't depend on hooks landing.
Related
Background
AGENTS.md mandates 90% test coverage for all code: "Ensure all code has corresponding tests. Ensure test coverage for each file is at least 90%." The Phase 1-5 component refactor explicitly deferred unit tests as out-of-scope, deferring the full coverage push to a single follow-up effort once the interface dust settled.
There is currently no Vitest config, no test runner, no test files in
clients/web/. The rootpackage.jsonhas a placeholder"test": "echo \"Error: no test specified\" && exit 1". Coverage is effectively zero.Scope
Test infrastructure:
@testing-library/react,@testing-library/jest-dom,jsdom(orhappy-dom) toclients/web/package.jsondevDependencies.vitest.config.tsconfigured for React + TypeScript with the existingtsconfig.app.json.npm run testandnpm run test:coveragescripts toclients/web/package.jsonand surface them at the root.c8/ built-in coverage reporter with the 90% threshold per AGENTS.md, failing the script when uncovered.Component tests (62 components):
clients/web/src/components/{elements,groups,screens,views}/has a<Name>.test.tsxfile.Core module tests (under
core/):core/mcp/types.ts— type-only file; covered by usage in component tests, not separate.core/mcp/elicitationCreateMessage.ts— schema validation tests.core/mcp/taskNotificationSchemas.ts— schema validation tests.clients/web/src/utils/jsonUtils.ts,schemaUtils.ts— pure-logic tests against AJV-validated fixtures.clients/web/src/components/groups/historyUtils.ts—extractMethodhappy-path and synthetic-response branch.Acceptance criteria
npm run testruns the full suite headlessly and exits 0 on a clean tree.npm run test:coveragereports ≥90% line coverage on every file underclients/web/src/components/andcore/mcp/..github/workflows/main.yml) is updated to runnpm run test:coverageon every PR; failure blocks merge.npm run testcommand (no longer "aspirational").Test plan
npm run test:coveragelocally; manually inspect a sample of generated test files for quality (not just coverage padding).npm run format && npm run lint && npm run buildcontinues clean.Out of scope
core/hook layer (its own tests live with the hook layer issue).Independent of
Related
specification/v2_ux_interfaces_plan.md§ "Out of this plan, but adjacent"npm run testcommand in the test plan checklist