-
Notifications
You must be signed in to change notification settings - Fork 200
Open OTP modal when user clicks proceed to shipping address #3243
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
Open OTP modal when user clicks proceed to shipping address #3243
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
| : `${appOrigin}${passwordlessConfigCallback}` | ||
|
|
||
| // Reset guest checkout flag when user registration status changes | ||
| useEffect(() => { |
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.
I don't believe this was necessary and the usage of useEffect causes unnecessary re-renders
22cce0d to
6d2724e
Compare
| } = useDisclosure() | ||
|
|
||
| // Helper function to validate email format | ||
| const isValidEmail = (email) => { |
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.
I can see this being needed in another component so I just moved it to a util that has it's own dedicated testing
| expect(screen.getByText('Please enter a valid email address.')).toBeInTheDocument() | ||
| }) | ||
|
|
||
| test('validates different types of valid emails correctly', async () => { |
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 tests validates email format on form submission and 'validates email is required on form submission' validates the case an invalid email is submitted. renders continue button for guest checkout and others exercise a valid email so we have coverage of both scenarios at the component level. For the specific email validation I added lots of test cases specifically in the utility
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.
You might want to fix linting (npm run lint:fix)
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
fbcd5f5
into
SalesforceCommerceCloud:feature/1cc_payments
Description
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization