Skip to content

added the requested tests to tests/recurring.test.ts to confirm that … - #569

Merged
BigBen-7 merged 1 commit into
Lead-Studios:mainfrom
ykargeee-bit:feat/Solvo
Aug 30, 2026
Merged

added the requested tests to tests/recurring.test.ts to confirm that …#569
BigBen-7 merged 1 commit into
Lead-Studios:mainfrom
ykargeee-bit:feat/Solvo

Conversation

@ykargeee-bit

Copy link
Copy Markdown
Contributor

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

  • Tests added or updated
  • Docs updated (JSDoc / README)
  • CHANGELOG.md updated under [Unreleased] (required by CI if src/ changed — see CONTRIBUTING.md)
  • API surface change is intentional, not accidental (public method signatures / exported types)
  • npm run build passes
  • npm test passes
  • npm run lint passes

…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.
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@BigBen-7
BigBen-7 merged commit 78d6c99 into Lead-Studios:main Aug 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment