-
Notifications
You must be signed in to change notification settings - Fork 21
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
Set default tax_rate to destination #2543
Set default tax_rate to destination #2543
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/2458-streamline-onboarding #2543 +/- ##
=======================================================================
+ Coverage 63.8% 65.6% +1.8%
- Complexity 0 4580 +4580
=======================================================================
Files 326 475 +149
Lines 5086 17891 +12805
Branches 1229 0 -1229
=======================================================================
+ Hits 3247 11737 +8490
- Misses 1672 6154 +4482
+ Partials 167 0 -167
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
This looks like it will work. Thanks for adding a new test class for the MerchantCenter\SettingsController
.
QA/Test Report- ✅Testing Environment -
Steps to Test- Please follow the steps mentioned in the PR description. If you are using Local software for your testing environment instead of 'wp-env' / Docker-based environment. Use this command to delete the option from DB - Test Results - All related tests are working as expected with this PR.
Functional Demo / Screencast - Recording.798.mp4Plugin file with this PR-specific build google-listings-and-ads.zip |
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.
Thanks for the changes.
I tested fetching the settings and received the expected default:
{
"shipping_rate": null,
"shipping_time": null,
"tax_rate": "destination",
"website_live": false,
"checkout_process_secure": false,
"payment_methods_visible": false,
"refund_tos_visible": false,
"contact_info_visible": false
}
I also tested setting some basic values without taxes and still got the expected default set:
{
"status": "success",
"message": "Merchant Center Settings successfully updated.",
"data": {
"shipping_rate": "automatic",
"shipping_time": "flat",
"tax_rate": "destination",
"website_live": true,
"checkout_process_secure": true,
"payment_methods_visible": true,
"refund_tos_visible": true,
"contact_info_visible": true
}
}
The code all looks good to me. Thanks for adding the extra unit test, it runs well.
There is no harm in merging this PR to develop, but that means it will get included in a release next Tuesday. Since it's going to be combined with #2542 I'd suggest to target a feature branch where both these PR's can get merged to.
c4bbdf0
into
feature/2458-streamline-onboarding
Changes proposed in this Pull Request:
The Tax Rate (the UI will be removed later; see #2490), shown on the second screen when a US country is selected, must default to destination.
Closes #2491.
Set the default value in the scheme property to
destination
. After the change,/wp-json/wc/gla/mc/settings
does show defaulttax_rate
asdestination
, in comparison to early `null. This was also reflected in Tax Rate UI.See the before and after change screenshot of the setting endpoint.
Screenshots:
Before: you can see
tax_rate
isnull
After: you can see
tax_rate
isdestination
Detailed test instructions:
npm run wp-env run cli wp option delete gla_merchant_center
to ensure it was not previously saved on a previous test.Tax rate (required for U.S. only)
below.My store uses destination-based tax rates.
.npm run wp-env run cli wp option get gla_merchant_center
. Note to QA:- You need to check this again once the UI removal is complete (Onboarding: Remove Tax Rates Selection UI #2490)Additional details:
Changelog entry