-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: tests for collection approval #419
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## chungquantin/feat-nfts #419 +/- ##
==========================================================
+ Coverage 70.48% 70.93% +0.44%
==========================================================
Files 72 72
Lines 13119 13313 +194
Branches 13119 13313 +194
==========================================================
+ Hits 9247 9443 +196
Misses 3600 3600
+ Partials 272 270 -2
|
@@ -2120,6 +2069,64 @@ fn cancel_approval_works() { | |||
}); | |||
} | |||
|
|||
#[test] | |||
fn cancel_approval_ensures_no_active_collection_approval() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only removed the events test and another storage check as it was already checked in the cancel_approval_works test
), | ||
Ok(Some(WeightOf::clear_collection_approvals(limit)).into()) | ||
); | ||
approvals = approvals - limit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this approvals mutation and limit variable only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Very clean. Thank you.
Refactors some of the test by separating the e.g. approve_collection_transfer and force_approve_collection_transfer, and while doing so found some small improvements.