Skip to content

test(backend): cover remittance retry after downstream failure (#2101) - #2210

Merged
K1NGD4VID merged 1 commit into
LabsCrypt:mainfrom
EmmyLee07:test/2101-remittance-route-idempotency
Oct 29, 2026
Merged

K1NGD4VID merged 1 commit into
LabsCrypt:mainfrom
EmmyLee07:test/2101-remittance-route-idempotency

Conversation

@EmmyLee07

Copy link
Copy Markdown
Contributor

Summary

Adds route-level coverage proving a remittance request can be retried with the same idempotency key after a downstream failure, without replaying or caching the 5xx response.

Linked issue

Closes #2101

Changes

  • Adds a deterministic downstream service rejection to the existing remittance idempotency suite.
  • Asserts the public 500 error contract, then verifies a same-key retry succeeds as a fresh 201 response.

Screenshots / Demo

Not applicable for this backend-only test change. Verification output:

Test Suites: 2 passed, 2 total
Tests:       16 passed, 16 total

Implementation notes

Uses the existing Jest/Supertest route harness and mocked remittance service/cache. No production code changes are needed: the test locks in the existing contract that 5xx responses are not cached and the in-flight reservation is released.

Testing

  • cd backend && npm test -- --runInBand src/__tests__/remittanceIdempotency.test.ts src/__tests__/remittanceRoutes.test.ts - passed (16 tests).
  • cd backend && npm run typecheck - passed.
  • cd backend && npm run build - passed.
  • cd backend && npm run lint - passed with 43 existing warnings; no warnings in the edited test.

Acceptance criteria

  • Add deterministic tests for success, failure, boundary, and authorization paths described above, together with the existing route suite.
  • Assert public error behavior and same-key retry after downstream failure.
  • CI run and confirmation.

Checklist

  • Follows CONTRIBUTING guidelines and code style.
  • Lint, build, typecheck, and affected tests pass locally.
  • No unrelated changes.
  • Docs/changelog not required for test-only coverage.
  • Rebased on latest upstream main, no conflicts.
  • No AI-disclosure requirement found in repository guidance.

Notes for reviewers

CI checks will run on the pull request.

@K1NGD4VID
K1NGD4VID merged commit 5616950 into LabsCrypt:main Oct 29, 2026
17 checks passed
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.

[test] Cover remittance route idempotency

2 participants