DOB-6: Test fixture overhaul — replace config/*.json fixture imports with TS preset modules #798

Closed
opened 2026-05-03 18:05:55 +00:00 by claude-desktop · 1 comment
Collaborator

As a maintainer, I want every test that currently imports or readFiles a config/*.json factory file replaced with a hand-rolled TS fixture module (or with the new presets.ts from DOB-3), so that DOB-5 can land without breaking any test.

The factory files are about to be deleted. Tests that read them must be migrated to inline fixtures or shared TS presets first.

Acceptance criteria

Audit + migrate

  • grep -rln 'config/.*\\.json' apps/ packages/ --include='*.test.*' --include='*.test.tsx' returns zero hits post-PR.
  • Each call site migrated to one of:
    • Hand-rolled per-test fixture — when the test cares about specific fields and inlining keeps the test self-explanatory.
    • Shared apps/server/src/test-fixtures/<kind>.ts — when several tests share a baseline fixture (e.g. "a typical agent_type row", "a typical service_config row"). Module exports typed const factories like makeAgentType(overrides?).
    • Reuse setup/presets.ts from DOB-3 — when a test wants the wizard's preset behaviour end-to-end.
  • Helper functions loadAgentsConfigForTest() / loadServiceConfigForTest() (or whatever the current names are) deleted along with the JSON readers.

Test parity

  • All affected tests still pass with identical assertions — fixture data shape unchanged, only the import source changed.
  • No test silently turned into a no-op via missing-file-fallback. Add a smoke assertion (expect(fixture.types.length).toBeGreaterThan(0)) on the trickiest ones to catch this.

Documentation

  • apps/server/src/test-fixtures/README.md (one-pager) describing the fixture pattern: when to use the shared module vs. inline, naming convention, no-JSON-allowed rule.

Out of scope

  • The actual file deletion — DOB-5.
  • Test infrastructure changes beyond the fixture migration (e.g. changing test runners, adding new harnesses).

References

  • Depends on: DOB-3 (#795) for presets.ts.
  • Sibling-of: DOB-5 (#797). DOB-5 cannot land until this is in.
As a maintainer, I want every test that currently imports or `readFile`s a `config/*.json` factory file replaced with a hand-rolled TS fixture module (or with the new `presets.ts` from DOB-3), so that DOB-5 can land without breaking any test. The factory files are about to be deleted. Tests that read them must be migrated to inline fixtures or shared TS presets first. ## Acceptance criteria ### Audit + migrate - [ ] `grep -rln 'config/.*\\.json' apps/ packages/ --include='*.test.*' --include='*.test.tsx'` returns zero hits post-PR. - [ ] Each call site migrated to one of: - **Hand-rolled per-test fixture** — when the test cares about specific fields and inlining keeps the test self-explanatory. - **Shared `apps/server/src/test-fixtures/<kind>.ts`** — when several tests share a baseline fixture (e.g. "a typical agent_type row", "a typical service_config row"). Module exports typed const factories like `makeAgentType(overrides?)`. - **Reuse `setup/presets.ts` from DOB-3** — when a test wants the wizard's preset behaviour end-to-end. - [ ] Helper functions `loadAgentsConfigForTest()` / `loadServiceConfigForTest()` (or whatever the current names are) deleted along with the JSON readers. ### Test parity - [ ] All affected tests still pass with identical assertions — fixture data shape unchanged, only the import source changed. - [ ] No test silently turned into a no-op via missing-file-fallback. Add a smoke assertion (`expect(fixture.types.length).toBeGreaterThan(0)`) on the trickiest ones to catch this. ### Documentation - [ ] `apps/server/src/test-fixtures/README.md` (one-pager) describing the fixture pattern: when to use the shared module vs. inline, naming convention, no-JSON-allowed rule. ## Out of scope - The actual file deletion — DOB-5. - Test infrastructure changes beyond the fixture migration (e.g. changing test runners, adding new harnesses). ## References - Depends on: DOB-3 (#795) for `presets.ts`. - Sibling-of: DOB-5 (#797). DOB-5 cannot land until this is in.
Collaborator

🤖 Auto-assigned to code-lead (heuristic: area:agents → code-lead (architecture-touching)). Reply /unassign to reroute.

🤖 Auto-assigned to **code-lead** (heuristic: area:agents → code-lead (architecture-touching)). Reply `/unassign` to reroute.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
charles/claude-hooks#798
No description provided.