Skip to content

test: add emergency pause/unpause scenario tests (#878)#922

Merged
Xoulomon merged 2 commits into
Xoulomon:mainfrom
euniceamoni:feat/issue-878-pause-unpause-tests
May 30, 2026
Merged

test: add emergency pause/unpause scenario tests (#878)#922
Xoulomon merged 2 commits into
Xoulomon:mainfrom
euniceamoni:feat/issue-878-pause-unpause-tests

Conversation

@euniceamoni
Copy link
Copy Markdown
Contributor

Summary

Adds dedicated test cases for the emergency pause/unpause contract functions as specified in issue #878.

Tests added

Test Covers
test_contribute_fails_when_group_paused contribute() returns InvalidState (1003) when group is paused
test_execute_payout_fails_when_group_paused execute_payout() returns InvalidState (1003) when group is paused
test_operations_resume_after_unpause Status returns to Active and paused flag is cleared after unpause_group()
test_pause_group_non_creator_rejected Non-creator cannot pause a group
test_unpause_group_non_creator_rejected Non-creator cannot unpause a group

A setup_active_group helper is included to reduce boilerplate across the new tests.

Files changed

  • contracts/stellar-save/src/lib.rs — 158 lines added (tests only, no logic changes)

Closes #878

- test_contribute_fails_when_group_paused: verifies contribute() returns
  InvalidState (1003) when group is paused
- test_execute_payout_fails_when_group_paused: verifies execute_payout()
  returns InvalidState (1003) when group is paused
- test_operations_resume_after_unpause: verifies status returns to Active
  and paused flag is cleared after unpause_group()
- test_pause_group_non_creator_rejected: non-creator cannot pause
- test_unpause_group_non_creator_rejected: non-creator cannot unpause
- setup_active_group helper for shared test setup
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@euniceamoni 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

@Xoulomon Xoulomon merged commit 48bba82 into Xoulomon:main May 30, 2026
13 of 41 checks 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.

[Testing] Write tests for emergency pause/unpause scenarios

2 participants