-
Notifications
You must be signed in to change notification settings - Fork 133
Introduce tests for WooPosVariationMapper #14770
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
Introduce tests for WooPosVariationMapper #14770
Conversation
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.
Pull Request Overview
This PR introduces comprehensive unit tests for the WooPosVariationMapper class, which is responsible for mapping product variation data between different data models in the WooCommerce POS system.
Key Changes:
- Added 41 test cases covering all mapping functions in WooPosVariationMapper
- Tests cover mapping from ProductVariation, WCProductVariationModel, and WooPosVariationEntity to WooPosVariation
- Tests validate name formatting functions for POS display (both
getName
andgetNameForPOS
)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📲 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #14770 +/- ##
============================================
+ Coverage 38.28% 38.34% +0.06%
- Complexity 10011 10041 +30
============================================
Files 2118 2118
Lines 118502 118502
Branches 15827 15827
============================================
+ Hits 45364 45443 +79
+ Misses 68924 68836 -88
- Partials 4214 4223 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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, thank you!
#WOOMOB-1286
Description
Adds unit tests for WooPosVariationMapper.
Note: I decided to initialize an actual Gson instead of mocking it. Since it's a well-tested library, it feels better to have an instance of the class in the tests.
Testing information
Green CI
The tests that have been performed
Green CI
Images/gif
N/A
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.