test(schemas): add tests for deal.ts sub-class schemas - #10
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 themanualStageOverrideSchemarequest schema. The schemas were merged tomainwith parity in place but without dedicated tests; this PR closes that gap.dealCursorPaginatedResponseSchema,proformaFieldValueSchema,proformaFieldGroupSchema,proformaReturnsResponseSchema,watchlistStatusResponseSchema,stageChangeLogResponseSchema,stageHistoryResponseSchema,kanbanBoardResponseSchema,stageMappingResponseSchema,manualStageOverrideSchemadescribeblocks, each schema exercised for happy path, null/optional handling, and at least one edge casesrc/lib/api/schemas/__tests__/deal-subclasses.test.tsmirrors the style of the existingdeal.test.ts(vitest,makeBackendDealfactory, fake timers where the innerbackendDealSchematransform 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 locallydeal.test.ts-> existing coverage is untouchedCI expectations: only the frontend workflow is exercised by this change. No backend, alembic, or e2e impact.
Generated with Claude Code