Fix 640#805
Merged
Merged
Conversation
|
@kodegreen70 is attempting to deploy a commit to the oseh-svg's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@kodegreen70 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! 🚀 |
Contributor
|
@kodegreen70 please fix merge conflicts |
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.
Add counter accounting tests for get_total_pro_subscriptions
Closes #640
Summary
get_total_pro_subscriptionstracks the number of active pro subscriptions but had no tests verifying the counter increments on subscribe or decrements on cancel. This PR adds three focused tests that lock in the accounting logic and guard against regressions.Changes
contract/contracts/pro_subscription/src/test.rsThree new tests added under the
Issue #640section:test_total_subscriptions_increments_on_subscribetest_total_subscriptions_decrements_on_canceltest_total_subscriptions_no_double_countsubscribe_procall while active fails withSubscriptionAlreadyActiveand the counter stays at 1No production code was changed — this is a test-only addition.
How to Test
cargo test -p pro-subscriptionAll pre-existing tests continue to pass alongside the three new ones.
Acceptance Criteria
test_total_subscriptions_increments_on_subscribeexists and passestest_total_subscriptions_decrements_on_cancelexists and passestest_total_subscriptions_no_double_countexists and passescargo test -p pro-subscriptionexits with code 0