Skip to content

test(transactions): cover history route integration#494

Open
h1065153539-create wants to merge 1 commit into
CredenceOrg:mainfrom
h1065153539-create:test/transactions-route-integration
Open

test(transactions): cover history route integration#494
h1065153539-create wants to merge 1 commit into
CredenceOrg:mainfrom
h1065153539-create:test/transactions-route-integration

Conversation

@h1065153539-create

Copy link
Copy Markdown

Summary

  • Adds supertest integration coverage for GET /api/transactions/history in tests/routes/transactions.test.ts.
  • Covers deterministic ordering, bond filters, limit/cursor pagination, empty results, validation envelopes, repository failure handling, and 401/403 authorization cases.
  • Decodes opaque cursors during query validation before passing them to SettlementsRepository.findManyPaginated.
  • Protects transaction history reads with the existing trust:read API-key scope.

Closes #472

Validation

  • npm test -- transactions passed: 1 test file, 10 tests.
  • git diff --check -- src/routes/transactions.ts src/schemas/transactions.ts tests/routes/transactions.test.ts passed.
  • npm run test:coverage -- transactions ran the focused tests successfully, then exited non-zero because the repo applies global thresholds to all src/**/*.ts and src/sdk/** during a filtered run.
  • File-level coverage from coverage/coverage-final.json:
    • src/routes/transactions.ts: 100% statements, 100% branches, 100% functions, 100% lines.
    • src/schemas/transactions.ts: 100% statements, 90% branches, 100% functions, 100% lines.
  • npm run lint is blocked before linting by missing src/observability/eslint-plugin-logger-schema.js imported from eslint.config.js.
  • npm run build is still blocked by existing repo-wide TypeScript errors, but no transactions-related errors remain after this change.

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.

Add integration tests for the transactions route (src/routes/transactions.ts)

1 participant