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

Add test coverage to BulkLineItemsController actions #7576

Merged

Conversation

Matt-Yorkley
Copy link
Contributor

@Matt-Yorkley Matt-Yorkley commented May 7, 2021

What? Why?

Adds more detailed test coverage to BulkLineItemsController actions, which are used to change line items in orders via the Bulk Order Management page.

This spec includes taxes on line items, enterprise fees on both the order and on line items, taxes on those fees (both inherited and non-inherited), shipping and payment fees and taxes on shipping. It checks all of these things are correctly updated after the order is changed via BOM.

What should we test?

Green build, it's just specs.

Release notes

Increased test coverage on BulkLineItemsController

Changelog Category: Technical changes

This spec includes taxes on line items, fees on the order and on line items, taxes on fees (inherited and non-inherited), shipping and payment fees and taxes on shipping. It checks all of these things are correctly updated after the order is changed via BOM.
@Matt-Yorkley Matt-Yorkley self-assigned this May 7, 2021
expect(order.total).to eq 61.0
expect(order.item_total).to eq 40.0
expect(order.adjustment_total).to eq 21.0
expect(order.included_tax_total).to eq 2.65 # Pending: this should be 3.10!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is fixed in #7429

@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #7576 (43e41f4) into master (35671e2) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7576      +/-   ##
==========================================
+ Coverage   93.18%   93.20%   +0.01%     
==========================================
  Files         635      635              
  Lines       18130    18136       +6     
==========================================
+ Hits        16895    16904       +9     
+ Misses       1235     1232       -3     
Impacted Files Coverage Δ
app/models/calculator/flat_percent_per_item.rb 92.30% <0.00%> (-0.55%) ⬇️
app/models/calculator/flexi_rate.rb 95.83% <0.00%> (-0.17%) ⬇️
app/models/spree/product.rb 91.30% <0.00%> (-0.09%) ⬇️
app/models/calculator/default_tax.rb 97.87% <0.00%> (-0.05%) ⬇️
app/models/spree/variant.rb 99.10% <0.00%> (-0.02%) ⬇️
app/models/calculator/per_item.rb 100.00% <0.00%> (ø)
app/models/calculator/flat_rate.rb 100.00% <0.00%> (ø)
app/models/calculator/price_sack.rb 100.00% <0.00%> (ø)
app/services/process_payment_intent.rb 100.00% <0.00%> (ø)
app/models/calculator/flat_percent_item_total.rb 100.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35671e2...43e41f4. Read the comment docs.

Copy link
Contributor

@andrewpbrett andrewpbrett left a comment

Choose a reason for hiding this comment

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

💪 🚀

@andrewpbrett
Copy link
Contributor

I feel like this one could probably just get merged with one review...

@Matt-Yorkley Matt-Yorkley merged commit 902bbf7 into openfoodfoundation:master May 10, 2021
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.

2 participants