Skip to content

Github Action on End to End Integration Test for claim verification l…#241

Open
yunus-dev-codecrafter wants to merge 1 commit intoPulsefy:mainfrom
yunus-dev-codecrafter:Github_Action
Open

Github Action on End to End Integration Test for claim verification l…#241
yunus-dev-codecrafter wants to merge 1 commit intoPulsefy:mainfrom
yunus-dev-codecrafter:Github_Action

Conversation

@yunus-dev-codecrafter
Copy link
Copy Markdown

Closes #238

Summary

I have created a comprehensive e2e test suite for the full claim flow from request to onchain disbursement. Here's what I've implemented:

Test File: full-claim-flow.e2e-spec.ts

Key Features:

  • Supertest Integration: Uses Supertest for API endpoint testing
  • Mocked External Services:
    • AI Service (OpenAI API) mocked via HttpService
    • Stellar SDK mocked via the existing MockOnchainAdapter
  • Full Lifecycle Testing: Covers the complete flow:
    1. Create Claim
    2. Enqueue Verification
    3. AI Verification Success
    4. Approve Claim
    5. Disburse with Onchain Transaction
  • Database State Verification: Checks claim status transitions and audit logs at each step
  • Deterministic Testing: Manually triggers verification processing for reliable test execution

Test Scenarios:

  1. Successful Full Flow: Tests the happy path with AI verification success
  2. Verification Failure: Tests handling of failed AI verification

Mocking Strategy:

  • HTTP calls to AI service return mock OCR success/failure responses
  • BullMQ queues are mocked to prevent Redis dependencies
  • Onchain adapter uses the existing mock implementation for deterministic blockchain interactions

Assertions Include:

  • API response validation
  • Database state changes (claim status progression)
  • Audit log entries for all operations
  • External service call verification
  • Onchain transaction metadata

The test is designed to run in a CI/CD environment with proper database and Redis setup. For local development, you may need to ensure PostgreSQL and Redis are running, or modify the test configuration to use in-memory alternatives.

To run the test:

cd /workspaces/Soter/app/backend
npm run test:e2e -- --testPathPattern=full-claim-flow.e2e-spec.ts

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@yunus-dev-codecrafter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

End-to-End Integration Tests for Claim Verification Lifecycle

2 participants