Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,6 @@ describe('Checkout One Click', () => {
})
).toBeInTheDocument()

// Billing address should default to the shipping address

// Should display billing address that matches shipping address
expect(step3Content.getByText('123 Main St')).toBeInTheDocument()

// Edit billing address
// Toggle to edit billing address (not via same-as-shipping label in this flow)
// Click the checkbox by role if present; otherwise skip
Expand Down Expand Up @@ -1208,10 +1203,6 @@ describe('Checkout One Click', () => {
})
).toBeInTheDocument()

// Verify billing address is displayed (it shows John Smith from the mock)
expect(step3Content.getByText('John Smith')).toBeInTheDocument()
expect(step3Content.getByText('123 Main St')).toBeInTheDocument()

// Verify UserRegistration component is hidden for registered customers
expect(screen.queryByTestId('sf-user-registration-content')).not.toBeInTheDocument()

Expand Down Expand Up @@ -2650,7 +2641,7 @@ describe('Checkout One Click', () => {

// Click "Edit Payment Info" button
const editPaymentButton = screen.getByRole('button', {
name: /toggle_card.action.editPaymentInfo|Edit Payment Info/i
name: /toggle_card.action.changePaymentInfo|Change/i
})
await user.click(editPaymentButton)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ const ContactInfo = ({isSocialEnabled = false, idps = [], onRegisteredUserChoseG
}
}

const customerEmail = customer?.email || form.getValues('email')
const customerPhone = customer?.phoneHome || form.getValues('phone')

return (
<>
<ToggleCard
Expand All @@ -535,8 +538,8 @@ const ContactInfo = ({isSocialEnabled = false, idps = [], onRegisteredUserChoseG
id: 'checkout_contact_info.action.sign_out'
})
: formatMessage({
defaultMessage: 'Edit',
id: 'checkout_contact_info.action.edit'
defaultMessage: 'Change',
id: 'checkout_contact_info.action.change'
})
}
>
Expand Down Expand Up @@ -666,18 +669,14 @@ const ContactInfo = ({isSocialEnabled = false, idps = [], onRegisteredUserChoseG
</Container>
</ToggleCardEdit>

{(customer?.email || form.getValues('email')) && (
{customerEmail ? (
<ToggleCardSummary>
<Stack spacing={1}>
<Text>{customer?.email || form.getValues('email')}</Text>
{(customer?.phoneHome || form.getValues('phone')) && (
<Text fontSize="sm" color="gray.600">
{customer?.phoneHome || form.getValues('phone')}
</Text>
)}
<Text>{customerEmail}</Text>
{customerPhone && <Text>{customerPhone}</Text>}
</Stack>
</ToggleCardSummary>
)}
) : null}
</ToggleCard>

{/* Sign Out Confirmation Dialog */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ const Payment = ({
disabled={appliedPayment == null}
onEdit={handleEditPayment}
editLabel={formatMessage({
defaultMessage: 'Edit Payment Info',
id: 'toggle_card.action.editPaymentInfo'
defaultMessage: 'Change',
id: 'toggle_card.action.changePaymentInfo'
})}
>
<ToggleCardEdit>
Expand Down Expand Up @@ -580,18 +580,15 @@ const Payment = ({

<Divider borderColor="gray.100" />

{(selectedBillingAddress ||
(effectiveBillingSameAsShipping && selectedShippingAddress)) && (
{selectedBillingAddress && !effectiveBillingSameAsShipping && (
<Stack spacing={2}>
<Heading as="h3" fontSize="md">
<FormattedMessage
defaultMessage="Billing Address"
id="checkout_payment.heading.billing_address"
/>
</Heading>
<AddressDisplay
address={selectedBillingAddress || selectedShippingAddress}
/>
<AddressDisplay address={selectedBillingAddress} />
</Stack>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ describe('Payment Component', () => {
// Click Edit Payment Info to enter edit mode
const summary = screen.getAllByTestId('toggle-card-summary').pop()
const editButton = within(summary).getByRole('button', {
name: /toggle_card.action.editPaymentInfo|Edit Payment Info/i
name: /toggle_card.action.changePaymentInfo|Change/i
})
await user.click(editButton)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ export default function ShippingOptions() {
}
onEdit={() => goToStep(STEPS.SHIPPING_OPTIONS)}
editLabel={formatMessage({
defaultMessage: 'Edit Shipping Options',
id: 'toggle_card.action.editShippingOptions'
defaultMessage: 'Change',
id: 'toggle_card.action.changeShippingOptions'
})}
>
<ToggleCardEdit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,10 @@
"value": " with your confirmation number and receipt shortly."
}
],
"checkout_contact_info.action.edit": [
"checkout_contact_info.action.change": [
{
"type": 0,
"value": "Edit"
"value": "Change"
}
],
"checkout_contact_info.action.sign_out": [
Expand Down Expand Up @@ -4681,6 +4681,18 @@
"value": "Change"
}
],
"toggle_card.action.changePaymentInfo": [
{
"type": 0,
"value": "Change"
}
],
"toggle_card.action.changeShippingOptions": [
{
"type": 0,
"value": "Change"
}
],
"toggle_card.action.edit": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,10 @@
"value": " with your confirmation number and receipt shortly."
}
],
"checkout_contact_info.action.edit": [
"checkout_contact_info.action.change": [
{
"type": 0,
"value": "Edit"
"value": "Change"
}
],
"checkout_contact_info.action.sign_out": [
Expand Down Expand Up @@ -4681,6 +4681,18 @@
"value": "Change"
}
],
"toggle_card.action.changePaymentInfo": [
{
"type": 0,
"value": "Change"
}
],
"toggle_card.action.changeShippingOptions": [
{
"type": 0,
"value": "Change"
}
],
"toggle_card.action.edit": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2473,14 +2473,14 @@
"value": "]"
}
],
"checkout_contact_info.action.edit": [
"checkout_contact_info.action.change": [
{
"type": 0,
"value": "["
},
{
"type": 0,
"value": "Ḗḓīŧ"
"value": "Ƈħȧȧƞɠḗḗ"
},
{
"type": 0,
Expand Down Expand Up @@ -9841,6 +9841,34 @@
"value": "]"
}
],
"toggle_card.action.changePaymentInfo": [
{
"type": 0,
"value": "["
},
{
"type": 0,
"value": "Ƈħȧȧƞɠḗḗ"
},
{
"type": 0,
"value": "]"
}
],
"toggle_card.action.changeShippingOptions": [
{
"type": 0,
"value": "["
},
{
"type": 0,
"value": "Ƈħȧȧƞɠḗḗ"
},
{
"type": 0,
"value": "]"
}
],
"toggle_card.action.edit": [
{
"type": 0,
Expand Down
10 changes: 8 additions & 2 deletions packages/template-retail-react-app/translations/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@
"checkout_confirmation.message.will_email_shortly": {
"defaultMessage": "We will send an email to <b>{email}</b> with your confirmation number and receipt shortly."
},
"checkout_contact_info.action.edit": {
"defaultMessage": "Edit"
"checkout_contact_info.action.change": {
"defaultMessage": "Change"
},
"checkout_contact_info.action.sign_out": {
"defaultMessage": "Sign Out"
Expand Down Expand Up @@ -1949,6 +1949,12 @@
"toggle_card.action.change": {
"defaultMessage": "Change"
},
"toggle_card.action.changePaymentInfo": {
"defaultMessage": "Change"
},
"toggle_card.action.changeShippingOptions": {
"defaultMessage": "Change"
},
"toggle_card.action.edit": {
"defaultMessage": "Edit"
},
Expand Down
10 changes: 8 additions & 2 deletions packages/template-retail-react-app/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@
"checkout_confirmation.message.will_email_shortly": {
"defaultMessage": "We will send an email to <b>{email}</b> with your confirmation number and receipt shortly."
},
"checkout_contact_info.action.edit": {
"defaultMessage": "Edit"
"checkout_contact_info.action.change": {
"defaultMessage": "Change"
},
"checkout_contact_info.action.sign_out": {
"defaultMessage": "Sign Out"
Expand Down Expand Up @@ -1949,6 +1949,12 @@
"toggle_card.action.change": {
"defaultMessage": "Change"
},
"toggle_card.action.changePaymentInfo": {
"defaultMessage": "Change"
},
"toggle_card.action.changeShippingOptions": {
"defaultMessage": "Change"
},
"toggle_card.action.edit": {
"defaultMessage": "Edit"
},
Expand Down
Loading