test(wallets): stabilize wallet activity integration tests with Prism…#574
Merged
Merged
Conversation
…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.
Closed
3 tasks
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.
…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
Assertion updates
Empty wallet coverage
Verification
This change improves test reliability, removes external infrastructure dependencies, and ensures the integration suite accurately reflects the wallet activity API contract.
Closes #570