-
Notifications
You must be signed in to change notification settings - Fork 134
[2/2] WCProductVariationModel
to Room: unit tests adjustments
#13982
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
[2/2] WCProductVariationModel
to Room: unit tests adjustments
#13982
Conversation
2 tests are failing right now
…ven` Room and WellSql have different defaults for sort. In this test, the order doesn't matter as all items have `menuOrder=0`
Don't use incorrect `$original.id` for description: instead, use simple string to avoid any confusion. Close database on test end
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
…rn default values Previously, functions like `VariationRepository#getProductVariationList` or `ProductDetailRepository#getCachedVariationCount` were *not* suspend. This allowed Mockito to return default values for both of the methods, respectively: empty list and 0. After recent changed, both of this functions were refactored to suspend, which caused Mockito to return `null` for them (see: mockito/mockito-kotlin#342) This comment brings back the previous behavior by mocking mentioned methods to return default values.
WCProductVariationModel
to Room: unit tests adjustmentsWCProductVariationModel
to Room: unit tests adjustments
…_variation_to_room_tests
d42c2e3
to
3e6c29c
Compare
FYI: As I was testing this change and running unit tests locally (in CLI), using the
The interesting thing is that tests run successfully when I split What's more interesting, after me doing the above, even Any idea on what might the problem be, did it happen on your side? Is it maybe related to PS: Also, I had no trouble running those unit tests from within the IDE (AS). |
WCProductVariationModel
to Room: working app #13972WCProductVariationModel
to Room: unit tests adjustments #13982Description
This PR adjusts unit tests execution after migrating
WCProductVariationModel
to Room in #13972 .Testing information
Please run the app and test different scenarios when using product variations. I don't have any specific scenario in mind, as this is a core change - this will affect all features related to variations.
Tip: you can set up a store with Jurassic Ninja and import the default set of products (https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/sample-data/sample_products.csv). One of the products has a few variations already to start with.
The tests that have been performed
Smoke tests of variations.
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: