Skip to content

test: add unit tests for verify-payment.service transaction build & error handling - #216

Open
Jerry-Tekh wants to merge 1 commit into
StellarState:devfrom
Jerry-Tekh:test/verify-payment-service
Open

test: add unit tests for verify-payment.service transaction build & error handling#216
Jerry-Tekh wants to merge 1 commit into
StellarState:devfrom
Jerry-Tekh:test/verify-payment-service

Conversation

@Jerry-Tekh

Copy link
Copy Markdown

Summary

Adds comprehensive unit tests covering verifyPaymentTransaction() in verify-payment.service.ts.

Changes

  • tests/unit/services/stellar/verify-payment.service.test.ts: Added unit test suite with 15+ test cases

Test Coverage

  • Mock Horizon.Server.transactions() responses for success and error codes
  • Payment amount delta comparison logic (within and outside allowed delta)
  • Retry behavior on 503 and network socket timeout
  • Transaction state transitions and conflict detection
  • Operation index disambiguation
  • 404 transaction not found handling
  • Rate limit (429) retry logic

Closes #145

…rror handling

Adds comprehensive unit tests covering verifyPaymentTransaction():
- Mock Horizon.Server.transactions() responses for success and error codes
- Payment amount delta comparison logic (within and outside allowed delta)
- Retry behavior on 503 and network socket timeout
- Transaction state transitions and conflict detection
- Operation index disambiguation

Closes StellarState#145
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.

[TESTING] Add unit tests for Soroban transaction build & error handling in verify-payment.service

1 participant