Skip to content

test(wallets): stabilize wallet activity integration tests with Prism…#574

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abimbolaalabi:feat/activity-feed
Jul 18, 2026
Merged

test(wallets): stabilize wallet activity integration tests with Prism…#574
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abimbolaalabi:feat/activity-feed

Conversation

@abimbolaalabi

Copy link
Copy Markdown
Contributor

…a mocks

Improve the wallet activity integration test suite by removing its dependency on a live database and aligning assertions with the API's actual response format.

Test fixes

  • Mock Prisma at the module level to isolate integration tests from a running PostgreSQL instance
  • Eliminate failures caused by unavailable database connections
  • Ensure tests execute consistently in local development and CI

Assertion updates

  • Correct response validation to match the API error structure
  • Update assertions from:
    • 'response.body.details'
  • To:
    • 'response.body.error.details'
  • Verify validation errors against the actual response payload returned by the controller

Empty wallet coverage

  • Replace the previous test that accepted both 200 and 404
  • Add a deterministic test for a valid Stellar wallet with no transaction history
  • Verify the endpoint returns:
    • HTTP 200
    • an empty data array
    • meta.total === 0
  • Align test expectations with the service implementation, which already treats an empty wallet as a successful query rather than an error

Verification

  • Confirm existing service behavior remains unchanged
  • Run the complete wallet activity test suite
  • All 5 wallet activity integration tests pass

This change improves test reliability, removes external infrastructure dependencies, and ensures the integration suite accurately reflects the wallet activity API contract.

Closes #570

…a mocks

Improve the wallet activity integration test suite by removing its dependency
on a live database and aligning assertions with the API's actual response
format.

### Test fixes
- Mock Prisma at the module level to isolate integration tests from a
  running PostgreSQL instance
- Eliminate failures caused by unavailable database connections
- Ensure tests execute consistently in local development and CI

### Assertion updates
- Correct response validation to match the API error structure
- Update assertions from:
  - 'response.body.details'
- To:
  - 'response.body.error.details'
- Verify validation errors against the actual response payload returned by
  the controller

### Empty wallet coverage
- Replace the previous test that accepted both 200 and 404
- Add a deterministic test for a valid Stellar wallet with no transaction
  history
- Verify the endpoint returns:
  - HTTP 200
  - an empty data array
  - meta.total === 0
- Align test expectations with the service implementation, which already
  treats an empty wallet as a successful query rather than an error

### Verification
- Confirm existing service behavior remains unchanged
- Run the complete wallet activity test suite
- All 5 wallet activity integration tests pass

This change improves test reliability, removes external infrastructure
dependencies, and ensures the integration suite accurately reflects the
wallet activity API contract.
@Chucks1093
Chucks1093 merged commit 6e32f7a into accesslayerorg:main Jul 18, 2026
1 check passed
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 test for activity feed returning empty array for wallet with no trade history

2 participants