-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve order updater test coverage #6377
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
Improve order updater test coverage #6377
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6377 +/- ##
=======================================
Coverage 89.45% 89.45%
=======================================
Files 974 974
Lines 20322 20322
=======================================
Hits 18179 18179
Misses 2143 2143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We were missing a spec for automations like the `CreateDiscountedItem` benefit.
The new tests use factories to more realistically set up orders, shipments, and inventory units in various states to simulate order updater functionality. Co-authored-by: Alistair Norman <[email protected]> Co-authored-by: Kendra Riga <[email protected]> Co-authored-by: Chris Todorov <[email protected]> Co-Authored-By: Adam Mueller <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]>
This removes the deprecation warnings from our test suite. Co-authored-by: Adam Mueller <[email protected]> Co-authored-by: Kendra Riga <[email protected]> Co-authored-by: Senem Soy <[email protected]>
We're proposing a new default for this configuration value, so this change updates the test in the new promotion system to not be dependent on the current default value. This test will fail if the default configuration changes. Co-authored-by: Benjamin Willems <[email protected]> Co-authored-by: Kendra Riga <[email protected]> Co-authored-by: Adam Mueller <[email protected]> Co-Authored-By: Alistair Norman <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]>
This is calling the recalculate method not update_adjustments. Co-Authored-By: Adam Mueller <[email protected]> Co-Authored-By: benjamin wil <[email protected]> Co-Authored-By: Andrew Stewart <[email protected]> Co-Authored-By: Harmony Bouvier <[email protected]> Co-Authored-By: Jared Norman <[email protected]> Co-Authored-By: Kendra Riga <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]> Co-Authored-By: Chris Todorov <[email protected]> Co-Authored-By: Tom Van Manen <[email protected]> Co-Authored-By: Noah Silvera <[email protected]>
Co-authored-by: Adam Mueller <[email protected]> Co-authored-by: Andrew Stewart <[email protected]> Co-authored-by: Jared Norman <[email protected]> Co-authored-by: Noah Silvera <[email protected]> Co-authored-by: benjamin wil <[email protected]> Co-Authored-By: Sofia Besenski <[email protected]> Co-Authored-By: Chris Todorov <[email protected]>
ba0b073 to
db98d00
Compare
mamhoff
left a comment
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.
Love some love for the test suite.
| initializer = SolidusPromotions::Engine.initializers.find { |i| i.name == "solidus_promotions.flickwerk_alias" } | ||
| initializer.run | ||
| expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("Spree::OrderUpdater") | ||
| expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("ThisIsATestClassName") |
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.
With #6376, we probably don't need the Flickwerk alias to be there anymore. Not blocking, just a note that the feature can be removed.
Summary
This pulls some of the test refactoring that was done in the in memory order updater PR into its own pull request. We improve some of the test coverage for the regular order updater. These changes were extracted from #5872
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: