Skip to content

Conversation

@sf-mkosak
Copy link

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • (step1)

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@sf-mkosak sf-mkosak requested a review from a team as a code owner September 4, 2025 17:04
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Sep 4, 2025

🎉 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(() => {
Copy link
Author

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

@sf-mkosak sf-mkosak force-pushed the mkosak.W-19525615.otp-continue-shipping-bugfix branch from 22cce0d to 6d2724e Compare September 4, 2025 17:06
} = useDisclosure()

// Helper function to validate email format
const isValidEmail = (email) => {
Copy link
Author

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 () => {
Copy link
Author

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

Copy link
Contributor

@dannyphan2000 dannyphan2000 left a 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)

Copy link
Contributor

@dannyphan2000 dannyphan2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sf-mkosak sf-mkosak merged commit fbcd5f5 into SalesforceCommerceCloud:feature/1cc_payments Sep 4, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants