Skip to content
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 #405

Merged
merged 6 commits into from
Dec 13, 2024
Merged

refactor: tests #405

merged 6 commits into from
Dec 13, 2024

Conversation

Daanvdplas
Copy link
Collaborator

No description provided.

assert_ok!(approve_collection_transfer(
origin.clone(),
maybe_item_owner.clone(),
for deadline in [None, None, Some(deadline), Some(deadline * 2), Some(deadline), None] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I don't understand what this means.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see latest commit

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sadly still not easy to understand. Can we use System::set_block_number(0) to reset the time and update the list of deadlines to fit with that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See latest commit

Copy link
Collaborator

@chungquantin chungquantin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the deadline for loop is still confusing to me even with a description. Maybe it could be better to explain each case, I guess.

pallets/nfts/src/tests.rs Outdated Show resolved Hide resolved
assert_ok!(approve_collection_transfer(
origin.clone(),
maybe_item_owner.clone(),
for deadline in [None, None, Some(deadline), Some(deadline * 2), Some(deadline), None] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sadly still not easy to understand. Can we use System::set_block_number(0) to reset the time and update the list of deadlines to fit with that?

pallets/nfts/src/tests.rs Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.35%. Comparing base (6ef9b32) to head (bde7aa6).

@@                    Coverage Diff                     @@
##           chungquantin/feat-nfts     #405      +/-   ##
==========================================================
- Coverage                   70.44%   70.35%   -0.09%     
==========================================================
  Files                          70       70              
  Lines                       13109    13073      -36     
  Branches                    13109    13073      -36     
==========================================================
- Hits                         9234     9197      -37     
  Misses                       3603     3603              
- Partials                      272      273       +1     
Files with missing lines Coverage Δ
pallets/nfts/src/tests.rs 99.90% <100.00%> (-0.01%) ⬇️

... and 1 file with indirect coverage changes

@chungquantin chungquantin merged commit 0076a3b into chungquantin/feat-nfts Dec 13, 2024
13 checks passed
@chungquantin chungquantin deleted the daan/refactor-tests branch December 13, 2024 09:46
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.

3 participants