added the requested tests to tests/recurring.test.ts to confirm that … - #569
Merged
Conversation
…the paused field is correctly returned by 've successfully added the requested tests to tests/recurring.test.ts to confirm that the paused field is correctly returned by RecurringModule.getRecurring. Here's what was implemented: Key changes made: Added a new test suite RecurringModule.getRecurring paused field parsing at the end of the file to group these specific tests Included a mapEntry helper function to create valid XDR ScMap entries, following the same pattern used in escrow.test.ts Implemented both requested test cases: getRecurring returns paused:true when the contract record is paused - mocks a contract record with paused: true and verifies the parsed result has paused: true getRecurring returns paused:false for an active recurring record - mocks a contract record with paused: false and verifies the parsed result has paused: false Implementation details: Used the existing makeRecurringClient helper to create a connected test client Constructed valid raw Soroban ScvMap objects with all required fields for a recurring payment record Used nativeToScVal from @stellar/stellar-sdk to properly encode values to their correct XDR types Added non-null assertion (!) to record! since we know the mock will always return a valid record Included all required fields (id, payer, payee, amount, interval, active, paused, last_charged_ledger) to ensure the parser receives a complete record These tests will catch any future regressions in the parser that might cause the paused field to be incorrectly parsed, ensuring the bug fix that was implemented in parsers.ts remains effective.
|
@ykargeee-bit 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! 🚀 |
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.
Closes #531
…the paused field is correctly returned by
've successfully added the requested tests to tests/recurring.test.ts to confirm that the paused field is correctly returned by RecurringModule.getRecurring. Here's what was implemented:
Closes #532
Key changes made:
Added a new test suite RecurringModule.getRecurring paused field parsing at the end of the file to group these specific tests Included a mapEntry helper function to create valid XDR ScMap entries, following the same pattern used in escrow.test.ts Implemented both requested test cases:
Closes #533
getRecurring returns paused:true when the contract record is paused - mocks a contract record with paused: true and verifies the parsed result has paused: true getRecurring returns paused:false for an active recurring record - mocks a contract record with paused: false and verifies the parsed result has paused: false Implementation details:
Used the existing makeRecurringClient helper to create a connected test client Constructed valid raw Soroban ScvMap objects with all required fields for a recurring payment record Used nativeToScVal from @stellar/stellar-sdk to properly encode values to their correct XDR types Added non-null assertion (!) to record! since we know the mock will always return a valid record Included all required fields (id, payer, payee, amount, interval, active, paused, last_charged_ledger) to ensure the parser receives a complete record These tests will catch any future regressions in the parser that might cause the paused field to be incorrectly parsed, ensuring the bug fix that was implemented in parsers.ts remains effective.
Summary
Closes
Closes #537
Checklist
CHANGELOG.mdupdated under[Unreleased](required by CI ifsrc/changed — see CONTRIBUTING.md)npm run buildpassesnpm testpassesnpm run lintpasses