Add Storybook stories and e2e tests for mortgage ledger#4
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (32)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Sorry @Connorbelez, your pull request is larger than the review limit of 150000 diff characters
There was a problem hiding this comment.
Pull request overview
Adds a mortgage ownership “double-entry” ledger (Convex tables + mutations/queries + validation) along with a demo route, Storybook coverage for the new presentational components, and Playwright e2e coverage for the demo workflow.
Changes:
- Introduces Convex ledger backend: schema, validators, Tier 1/2 mutations, read APIs, invariant validation, and consumer cursors, plus convex-test integration tests.
- Adds
/demo/convex-ledgerroute and decomposes the demo UI into reusable components (with Storybook stories). - Adds Playwright e2e suites covering seeding, transfers, issuance, redemption, journal rendering, and cleanup.
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/demo/convex-ledger.tsx | New demo page wiring Convex queries/mutations to the ledger UI components |
| src/routeTree.gen.ts | Registers the new /demo/convex-ledger route |
| src/components/ledger/mortgage-card.tsx | Presentational card for per-mortgage balances/positions |
| src/components/ledger/mortgage-card.stories.tsx | Storybook coverage for MortgageCard states |
| src/components/ledger/ledger-controls.tsx | Seed/cleanup controls card for the demo |
| src/components/ledger/ledger-controls.stories.tsx | Storybook coverage for LedgerControls states |
| src/components/ledger/ledger-actions.tsx | Interactive Transfer/Issue/Redeem form UI |
| src/components/ledger/ledger-actions.stories.tsx | Storybook coverage for LedgerActions states |
| src/components/ledger/journal-log-table.tsx | Journal table rendering for ledger entries |
| src/components/ledger/journal-log-table.stories.tsx | Storybook coverage for JournalLogTable states |
| src/components/ledger/entry-type-badge.tsx | Badge component for displaying entry types |
| src/components/ledger/entry-type-badge.stories.tsx | Storybook coverage for EntryTypeBadge variants |
| specs/mortgage-ownership-ledger/tasks.md | Task checklist for ledger implementation/testing |
| specs/mortgage-ownership-ledger/gap-analysis.md | Coverage matrix + divergences vs spec |
| specs/mortgage-ownership-ledger/design.md | Design spec snapshot (schema, API, invariants, conventions) |
| specs/mortgage-ownership-ledger/PRD.md | PRD snapshot for the ledger feature |
| scripts/code-review.sh | Tweaks coderabbit invocation options |
| package.json | Adds Storybook testing utilities + convex-test dev dependency |
| e2e/convex-ledger.spec.ts | Playwright e2e suite for the ledger demo page |
| convex/tsconfig.json | Excludes Convex __tests__ from Convex TS compilation/codegen inputs |
| convex/schema.ts | Adds ledger_accounts, ledger_journal_entries, ledger_cursors tables + indexes |
| convex/ledger/validators.ts | Shared Convex validators for ledger entry types and mutation args |
| convex/ledger/validation.ts | Supply invariant validation query |
| convex/ledger/queries.ts | Ledger query APIs (balances, histories, point-in-time reconstruction) |
| convex/ledger/mutations.ts | Ledger Tier 1/2 mutations + posting validation pipeline |
| convex/ledger/internal.ts | Internal helpers (WORLD/TREASURY/POSITION accessors, sequence numbers, balances) |
| convex/ledger/cursors.ts | Cursor query/mutations for downstream consumers |
| convex/ledger/constants.ts | Ledger constants (units per mortgage, min position) |
| convex/ledger/tests/ledger.test.ts | convex-test + vitest integration tests for ledger behavior |
| convex/demo/ledger.ts | Demo seed/cleanup + demo-facing queries for the UI |
| convex/_generated/api.d.ts | Codegen updates to include demo + ledger modules |
| bun.lock | Lockfile updates for new dependencies |
| biome.json | Excludes Convex ledger tests from Biome; updates lint/assist config |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db59c1c to
112b9eb
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e40f36b to
e5cd312
Compare
112b9eb to
c8fe340
Compare
- Wrap handlePipelineLegConfirmed in try/catch to protect cash postings (#1, #11) - Make initiateTransferInternal retry-safe with early return (#2, #5, #10) - Fix misleading comment in startDealClosingPipeline (#4) - Add validatePipelineFields guard to public createTransferRequest (#7, #12) - Document supported provider codes for deal-closing (#8) - Filter pipeline legs by specific pipelineId in getPipelineStatus (#6) - Return null for unknown pipeline IDs in getTransfersByPipeline (#15) - Validate leg2Amount early in createDealClosingPipeline (#13) - computePipelineStatus prefers active legs over terminal after retry (#14) - Updated tests for retry scenarios (37 passing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary Completed comprehensive testing infrastructure for the mortgage ownership ledger feature: - **Storybook stories (22 stories across 5 components)**: Entry type badges, mortgage cards, ledger controls, journal tables, and interactive action forms. Stories cover happy paths and edge cases (broken invariants, empty states, loading states). - **E2E tests (22 tests across 8 suites)**: Full lifecycle testing from seed → transfer → issue → redeem → cleanup, plus isolated tests for layout, controls, mortgage cards, journal log, and error handling. - **Component refactoring**: Extracted monolithic demo page into 5 reusable presentational components, enabling better isolation and testability. All quality checks pass: `bun check`, `bun typecheck`, `bunx convex codegen`. ## Testing Strategy Stories enable visual regression testing without backend; e2e tests verify full user workflows with real Convex mutations. Test structure follows existing audit-traceability patterns with 15-second timeouts for Convex data loads. ## Changes - Added 33 files (5,731 insertions) - Core ledger infrastructure: mutations, queries, validation, cursors, tests - Spec documents: PRD, design, tasks, gap analysis - Frontend components: 5 presentational + 5 story files - E2E test suite with serial + parallel test groups 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
Completed comprehensive testing infrastructure for the mortgage ownership ledger feature:
All quality checks pass:
bun check,bun typecheck,bunx convex codegen.Testing Strategy
Stories enable visual regression testing without backend; e2e tests verify full user workflows with real Convex mutations. Test structure follows existing audit-traceability patterns with 15-second timeouts for Convex data loads.
Changes
🤖 Generated with Claude Code