@W-20161521: fix new guest registration flow#3468
@W-20161521: fix new guest registration flow#3468dannyphan2000 merged 2 commits intofeature/1cc_paymentsfrom
Conversation
Signed-off-by: d.phan <d.phan@salesforce.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| } | ||
| } catch { | ||
| } catch (_e) { | ||
| // Fail silently |
| await user.click(cb) // off | ||
| expect(props.onSavePreferenceChange).toHaveBeenCalledWith(false) | ||
| }) | ||
|
|
There was a problem hiding this comment.
just adding the remaining tests for ~100% coverage of the component
| pwdlessLoginToken: otpCode, | ||
| register_customer: true | ||
| }) | ||
|
|
There was a problem hiding this comment.
No need to call mergeBasket for a completely new user - the newly registered user would not have any existing basket before the registration
Signed-off-by: d.phan <d.phan@salesforce.com>
| productItems: [{productId: 'sku-1', quantity: 1}] | ||
| } | ||
| const {authorizePasswordlessLogin} = setup({basket: basketWithoutCustomerInfo}) | ||
| await user.click(screen.getByRole('checkbox', {name: /Create an account/i})) |
There was a problem hiding this comment.
Should we instead disable the checkbox? Would the user get a false sense that they will be registered?
There was a problem hiding this comment.
Hmm that makes sense - rare case again as well but we can log a bug for that fix as needed
| expect(screen.getByRole('checkbox', {name: /Create an account/i})).toBeInTheDocument() | ||
| }) | ||
|
|
||
| test('prevents duplicate OTP sends', async () => { |
| "value": "Add a new payment method to check out faster." | ||
| } | ||
| ], | ||
| "account.title.my_account": [ |
There was a problem hiding this comment.
These translations seem unrelated to the change itself.
There was a problem hiding this comment.
Yup just adding it because the build was complaining!
Fix New Guest Registration flow for One-Click Checkout layout.
Description
This PR fixes the issue of logging in a newly registered user from the Checkout page. The root cause was the unnecessary mergeBasket call for newly registered user and basket causing intermittent failures in mismatched customer/basket. The basket's owner is updated in-place via the registration call.
Types of Changes
Changes
use-basket-recoveryhook as well as its implementation in User Registration component to re-create basket.one-click-user-registrationfor 100% coverage.How to Test-Drive This PR
Follow 1CC guest-to-registered flow with OTP authentication via User Registration component
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization