Repository navigation
test(quotes): add comprehensive API HTTP contract integration test suite - #47
Merged
Merged
Conversation
- Create API contract integration test suite in tests/api/quotes-contract.test.ts covering POST /api/v1/quotes and related endpoints. - Minimum Amount: Enforces minNgnAmount limits (HTTP 400 for amounts under threshold). - Maximum Amount: Enforces maxNgnAmount and maxQuoteUsdcAmount limits. - Fee Rounding: Validates platform fee rounding and net source calculations. - USDC Truncation: Guarantees destination amount payout conforms to 6-decimal USDC precision bounds. - Spread Application: Verifies exchange rate spread calculations in quotes. - Network Fee Calculation: Asserts network fee presence and values in response payload. - Stale FX Rate: Validates HTTP 502 error responses when FX provider rate is stale. - Quote Expiration: Validates automatic status transition to EXPIRED and order rejection for expired quotes. - Quote Reuse Prevention: Validates single-use quote restriction when placing orders. - Quote/Order Mismatch: Verifies created orders strictly derive values from server quotes. - Liquidity Availability: Validates liquidityAvailable response status and order rejection when pool is depleted. - Malformed Payloads: Validates HTTP 400 validation error responses for bad parameters, negative/zero amounts, invalid UUIDs, and unsupported currency pairs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Brief description of what this PR introduces, fixes, or refactors in
luminarail-backend.Related Contributor Issue: Closes #
Type of Change
Verification & Quality Checklist
npm run type-checknpm run lintnpm run buildnpm testTest Verification Output