-
Notifications
You must be signed in to change notification settings - Fork 13
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
NJ 235 - fix calculator negative value bug #5706
Conversation
Heroku app: https://gyr-review-app-5706-f17cbf0d28b0.herokuapp.com/ |
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.
One small test improvement, otherwise looks good! Appreciate you finding all the relevant cases here & futureproofing
context 'when 28c is larger than 29' do | ||
it 'sets line 29 to zero' do | ||
allow(instance).to receive(:calculate_line_15).and_return 1_000 | ||
allow(instance).to receive(:calculate_line_16a).and_return 1_000 | ||
allow(instance).to receive(:calculate_line_28c).and_return 2_001 | ||
instance.calculate | ||
expect(instance.lines[:NJ1040_LINE_29].value).to eq(0) |
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.
[pebble] I think the test title is misleading here? It should be "when 28c is greater than line 27" (from looking at the code) right?
Additionally, if that is the case, I'd suggest/prefer to see the test simplified by just mocking Line 27 and Line 28c rather than lines 15 and 16a, which seems more complicated and harder to read/parse.
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.
That makes sense. The logic for line 27 has also changed in the meantime so this makes it more accurate.
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!
Link to pivotal/JIRA issue
Is PM acceptance required? (delete one)
Reminder: merge main into this branch and get green tests before merging to main
What was done?
How to test?
Screenshots (for visual changes)
Before

After
