-
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
Streamline onboarding: Clean up the access to the pre-launch checklist in the mc/settings
API
#2555
Streamline onboarding: Clean up the access to the pre-launch checklist in the mc/settings
API
#2555
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/2492-remove-pre-launch-checklist #2555 +/- ##
=============================================================================
+ Coverage 63.8% 65.2% +1.4%
- Complexity 0 4581 +4581
=============================================================================
Files 325 800 +475
Lines 5083 22899 +17816
Branches 1231 1230 -1
=============================================================================
+ Hits 3241 14928 +11687
- Misses 1674 7803 +6129
Partials 168 168
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Just adding a note that the failing unit test is not related to this PR and is being resolved in #2559 |
|
Merging |
e913578
to
b3e838f
Compare
e45c634
to
dd73ec6
Compare
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.
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.
Changes are cherry picked from https://github.com/woocommerce/google-listings-and-ads/pull/2559/commits to fix unit test failures. This can be ignored.
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.
Changes are cherry picked from https://github.com/woocommerce/google-listings-and-ads/pull/2559/commits to fix unit test failures. This can be ignored.
QA/Test Report- ✅Testing Environment -
Test Results - The changes are working as expected. The pre-launch checklist items are no longer available. The user able to complete onboarding without any trouble. The console and error logs are clear during the onboarding steps. Functional Demo / Screencast - |
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 can confirm that the payload no longer has the additional fields:
{
"shipping_rate": "automatic",
"shipping_time": "flat",
"tax_rate": "destination"
}
In the response they are also no longer being included:
{
"status": "success",
"message": "Merchant Center Settings successfully updated.",
"data": {
"shipping_rate": "automatic",
"shipping_time": "flat",
"tax_rate": "destination"
}
}
If I refresh the page I can confirm that the setup
status returns that onboarding is incomplete and on the paid_ads
step:
{
"status": "incomplete",
"step": "paid_ads"
}
I left one comment about the unit test replacement as that's going to be confusing if revisited, so I'd suggest to commit a follow up change to fix the test.
Since the code is working as expected and the tests still pass I'll go ahead and mark this as approved.
'refund_tos_visible' => true, | ||
'contact_info_visible' => true, | ||
] | ||
[] |
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.
One thing I wanted to mention here was that this test data is not a valid replacement. Because we no longer use the function checked_pre_launch_checklist
the options are not fetched a fourth time.
We can confirm that by checking specifically for how many times it's called by using something like:
$this->options->expects( $this->exactly( 4 ) )->method( 'get' )
Which will fail with a message:
Expectation failed for method name is "get" when invoked 4 time(s).
Method was expected to be called 4 times, actually called 3 times.
So I'd suggest to actually check that it's invoked 3 times as well as remove the parameters and response for the fourth time.
$this->options->expects( $this->exactly( 3 ) )->method( 'get' )
->withConsecutive(
[ OptionsInterface::MC_SETUP_COMPLETED_AT, false ],
[ OptionsInterface::TARGET_AUDIENCE ],
[ OptionsInterface::MERCHANT_CENTER, [] ]
)->willReturnOnConsecutiveCalls(
false,
[
'location' => 'selected',
'countries' => [ 'GB' ],
],
[]
);
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.
👍🏻 @kt-12 can you make these updates and request another review from me?
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.
Thank you @mikkamp and @joemcgill, I have addressed this 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.
The PHPUnit updates look right and tests are still passing. Since this was already approved I'm going to go ahead and merge.
40bbf82
into
feature/2492-remove-pre-launch-checklist
mc/settings
API
Changes proposed in this Pull Request:
This PR removed any backend related to a pre-launch checklist.
Closes #2494.
The PR addresses it's issue. Check screenshots section for after the change screenshots
Screenshots:
After:
All pre-launch checklist attributes removed from API
We are also able to move to last screen after the removal.
Detailed test instructions:
npm run build
gla_merchant_center
saved options usenpm run wp-env run cli wp option delete gla_merchant_center
Additional details:
Changelog entry