Skip to content

Build Regression Test Suite #69

Description

@Kalchaqui

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_statenew_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)

  • At least one regression spec per bug category listed above.
  • Each spec references its issue/PR in the title or header comment.
  • Independence check: specs pass when run in isolation and in any order.
  • CI runs the regression specs as part of pnpm test.

Proof of Completion (required)

  • Link the merged PR.
  • Paste the passing CI output showing the regression specs.
  • Provide a short index (table) mapping each regression test → the issue/PR it guards.
  • Link to the documented "fix requires a regression test" policy (README/CONTRIBUTING).

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions