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

test(finance): fix tests for amount #2702

Merged
merged 5 commits into from
Mar 7, 2024
Merged

test(finance): fix tests for amount #2702

merged 5 commits into from
Mar 7, 2024

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Mar 2, 2024

This PR fixes a rare bug in the finance tests, that cause them to fail when amount returns 0.

Previously the tests checked for 0 < amount < 1001
Now the check looks like this: 0 <= amount <= 1000

I also removed the dedicated it returns a string test in favor of more checks in the other tests.
And I removed some description texts, because they state the exact same as the check itself.

@ST-DDT ST-DDT added c: bug Something isn't working p: 1-normal Nothing urgent c: test m: finance Something is referring to the finance module labels Mar 2, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Mar 2, 2024
@ST-DDT ST-DDT requested review from a team March 2, 2024 00:04
@ST-DDT ST-DDT self-assigned this Mar 2, 2024
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.57%. Comparing base (ccd7054) to head (a17196c).

❗ Current head a17196c differs from pull request most recent head fdeb70e. Consider uploading reports for the commit fdeb70e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2702      +/-   ##
==========================================
+ Coverage   99.56%   99.57%   +0.01%     
==========================================
  Files        2859     2859              
  Lines      248915   248878      -37     
  Branches      986      630     -356     
==========================================
- Hits       247837   247827      -10     
+ Misses       1078     1022      -56     
- Partials        0       29      +29     

see 38 files with indirect coverage changes

@ST-DDT ST-DDT requested a review from a team March 2, 2024 08:18
@Shinigami92
Copy link
Member

@xDivisionByZerox I would like if you could take a look on this and approve accordingly
Because I'm not fully sure if 0 was an intended result or not

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

@xDivisionByZerox I would like if you could take a look on this and approve accordingly
Because I'm not fully sure if 0 was an intended result or not

Since the implementation did not change, this looks valid to me.


Additionally, I don't see why we should disallow 0 as return value. WHat would happen if the user provides 0 as min AND max value to the function?

@ST-DDT ST-DDT enabled auto-merge (squash) March 7, 2024 13:41
@ST-DDT ST-DDT merged commit e1dc906 into next Mar 7, 2024
14 checks passed
@ST-DDT ST-DDT deleted the test/fix/finance/amount branch March 15, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working c: test m: finance Something is referring to the finance module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants