Issue: Build Regression Test Suite
Depends on: Existing Jest test infrastructure (jest.config.js, existing *.spec.ts files)
Task Description
Create a Regression Test Suite so previously resolved production issues cannot silently reappear. Every fixed bug should ship with a regression test that references its originating issue/PR.
Deliverable
A dedicated regression suite integrated into the backend testing pipeline, organized so each test is traceable to the bug it guards.
Requirements
Create regression tests for:
- Previously fixed bugs (with issue/PR reference in the test description).
- Agreement synchronization issues (webhook status mapping — e.g.
escrow.released must set completed, not stay funded).
- Validation failures (e.g. dispute
payer_percentage + payee_percentage = 100; invalid Stellar address rejected).
- Status transition bugs (illegal transitions blocked; correct
previous_state → new_state).
- Activity logging bugs (transitions and dispute events land in
agreement_activity).
- API edge cases (invalid JWT, not-found IDs, unauthorized wallet on
by-wallet / mutations).
Each regression test must document its related issue.
Validation System
- Every listed bug category has at least one regression test tied to a real issue/PR.
- Re-introducing a known bug locally makes the corresponding test fail.
- The suite runs green in CI.
Technical Requirements
- Tests are independent (no shared mutable state; mock Supabase/TW).
- Execute in CI via
pnpm test (testRegex: .*\.spec\.ts$).
- Include a bug/issue reference in each
describe/it title or a header comment.
- Easy to extend via a clear convention (
*.regression.spec.ts, or a src/**/regression/ / __regression__ folder).
Additional Notes
Adopt a policy: future bug fixes are not "done" until a corresponding regression test exists. Suggested convention: colocate as *.regression.spec.ts so they're discoverable but distinguishable from unit specs.
Testing (required)
Proof of Completion (required)
Issue: Build Regression Test Suite
Depends on: Existing Jest test infrastructure (
jest.config.js, existing*.spec.tsfiles)Task Description
Create a Regression Test Suite so previously resolved production issues cannot silently reappear. Every fixed bug should ship with a regression test that references its originating issue/PR.
Deliverable
A dedicated regression suite integrated into the backend testing pipeline, organized so each test is traceable to the bug it guards.
Requirements
Create regression tests for:
escrow.releasedmust setcompleted, not stayfunded).payer_percentage + payee_percentage = 100; invalid Stellar address rejected).previous_state→new_state).agreement_activity).by-wallet/ mutations).Each regression test must document its related issue.
Validation System
Technical Requirements
pnpm test(testRegex: .*\.spec\.ts$).describe/ittitle or a header comment.*.regression.spec.ts, or asrc/**/regression//__regression__folder).Additional Notes
Adopt a policy: future bug fixes are not "done" until a corresponding regression test exists. Suggested convention: colocate as
*.regression.spec.tsso they're discoverable but distinguishable from unit specs.Testing (required)
pnpm test.Proof of Completion (required)