Skip to content

test(e2e): add liquidity operations flow coverage (#78)#101

Open
Ayomisco wants to merge 1 commit intoTrustUp-app:mainfrom
Ayomisco:feat/e2e-liquidity-flow-78
Open

test(e2e): add liquidity operations flow coverage (#78)#101
Ayomisco wants to merge 1 commit intoTrustUp-app:mainfrom
Ayomisco:feat/e2e-liquidity-flow-78

Conversation

@Ayomisco
Copy link
Copy Markdown

[E2E Tests] Liquidity Operations Flow Coverage (#78)

Summary

Implements E2E integration test coverage for all four liquidity endpoints, validating HTTP contracts, auth guards, and input validation without Redis or blockchain dependencies.

Test Coverage (10 scenarios)

GET /liquidity/overview

  • ✅ Returns pool metrics without authentication (public endpoint)

GET /liquidity/my-summary

  • ✅ Returns investment summary for authenticated user (wallet-scoped)
  • ✅ Returns 401 when no bearer token provided

POST /liquidity/deposit

  • ✅ Returns unsigned XDR + deposit preview for valid amount
  • ✅ Returns 400 below $10 minimum
  • ✅ Returns 400 above $1,000,000 maximum
  • ✅ Returns 401 without token

POST /liquidity/withdraw

  • ✅ Returns unsigned XDR + withdrawal preview for valid shares
  • ✅ Returns 400 when shares is zero
  • ✅ Returns 401 without token

Results

close #68

close #78

- GET /liquidity/overview: public pool metrics (no auth required)
- GET /liquidity/my-summary: investment summary with auth + 401 guard
- POST /liquidity/deposit: XDR preview, min/max validation, 401 guard
- POST /liquidity/withdraw: XDR preview, zero-shares validation, 401 guard
- 10 scenarios covering HTTP responses and service delegation
- Mocks LiquidityService + JwtAuthGuard; no Redis/blockchain deps
Copy link
Copy Markdown
Contributor

@Josue19-08 Josue19-08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ayomisco, thank you for your contribution to the project! 🙌

The HTTP contract tests for the four liquidity endpoints are well-structured, but issue #78 requires a more complete end-to-end flow. Here's what's missing:

  • Transaction submission tests — The issue requires "Test transaction submission for deposit (POST /transactions/submit)" and the same for withdrawal. These are not covered.

  • Complete end-to-end flow — The issue asks for testing the full path:
    deposit → submit transaction → confirm → check summary → withdraw.
    Currently each endpoint is called in isolation with a fully mocked service.

  • Database state verification — The issue requires "Verify database state changes (deposit history, share balances)." With LiquidityService fully mocked, no real state is checked.

Please extend the suite to cover these scenarios. Feel free to push the update and I'll take another look. Thanks again! 🚀

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.

E2E Integration Test Coverage Tracker (Meta-Issue) E2E Tests for Liquidity Operations Flow

2 participants