Skip to content

test(schemas): add tests for deal.ts sub-class schemas - #10

Merged
mborgeson merged 1 commit into
mainfrom
fix/zod-parity-deal-subclass-tests
Apr 30, 2026
Merged

test(schemas): add tests for deal.ts sub-class schemas#10
mborgeson merged 1 commit into
mainfrom
fix/zod-parity-deal-subclass-tests

Conversation

@mborgeson

Copy link
Copy Markdown
Owner

Summary

Adds dedicated unit-test coverage for the nine sibling response schemas introduced in PR #6 (fix(schemas): close deal.ts sub-class artifact parity gaps), plus the manualStageOverrideSchema request schema. The schemas were merged to main with parity in place but without dedicated tests; this PR closes that gap.

  • Schemas covered: dealCursorPaginatedResponseSchema, proformaFieldValueSchema, proformaFieldGroupSchema, proformaReturnsResponseSchema, watchlistStatusResponseSchema, stageChangeLogResponseSchema, stageHistoryResponseSchema, kanbanBoardResponseSchema, stageMappingResponseSchema, manualStageOverrideSchema
  • 35 new tests across 10 describe blocks, each schema exercised for happy path, null/optional handling, and at least one edge case
  • New file src/lib/api/schemas/__tests__/deal-subclasses.test.ts mirrors the style of the existing deal.test.ts (vitest, makeBackendDeal factory, fake timers where the inner backendDealSchema transform is invoked)

Complements PR #6

PR #6 shipped the schemas and Zod parity; this PR adds the missing test coverage so future regressions in the sub-class transforms surface immediately.

Test plan

  • npm run test:run -- src/lib/api/schemas/__tests__/deal-subclasses.test.ts -> 35/35 passing locally
  • Frontend CI (vitest, eslint, typecheck, vite build) green on the new file
  • No changes to existing deal.test.ts -> existing coverage is untouched

CI expectations: only the frontend workflow is exercised by this change. No backend, alembic, or e2e impact.

Generated with Claude Code

Adds dedicated unit-test coverage for the nine sibling response schemas
introduced in PR #6 (cursor pagination, proforma returns, watchlist,
stage change/history, kanban, stage mapping) plus the
manualStageOverrideSchema request schema. Mirrors the style of the
existing backendDealSchema tests and exercises happy path, null/optional
field handling, and edge cases for each schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mborgeson
mborgeson merged commit c791552 into main Apr 30, 2026
5 of 6 checks passed
@mborgeson
mborgeson deleted the fix/zod-parity-deal-subclass-tests branch April 30, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant