Skip to content

Commit 4b02e59

Browse files
committed
W-18818802 address code review comments
1 parent 0f8e9c7 commit 4b02e59

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/template-retail-react-app/app/pages/checkout/confirmation.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const CheckoutConfirmation = () => {
8282
lastName: data.lastName,
8383
email: data.email,
8484
login: data.email,
85-
phoneHome: order.shipments[0].shippingAddress.phone
85+
phoneHome: order.billingAddress.phone
8686
},
8787
password: data.password
8888
}

packages/template-retail-react-app/app/pages/checkout/confirmation.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ test('Create Account form - phone number from order shipping address is saved to
151151
expect(registrationRequestBody).not.toBeNull()
152152
})
153153

154-
// Verify that the phone number from the order's shipping address is included in the registration
154+
// Verify that the phone number from the order's billing address is included in the registration
155155
expect(registrationRequestBody.customer.phoneHome).toBe(
156-
mockOrder.shipments[0].shippingAddress.phone
156+
mockOrder.billingAddress.phone
157157
)
158158
expect(registrationRequestBody.customer.phoneHome).toBe('(778) 888-8888')
159159

@@ -176,7 +176,7 @@ test('Integration test - phone number from order is visible in customer account
176176
email: mockOrder.customerInfo.email,
177177
firstName: mockOrder.billingAddress.firstName,
178178
lastName: mockOrder.billingAddress.lastName,
179-
phoneHome: mockOrder.shipments[0].shippingAddress.phone,
179+
phoneHome: mockOrder.billingAddress.phone,
180180
login: mockOrder.customerInfo.email
181181
}
182182
return res(ctx.status(200), ctx.json(savedCustomerData))
@@ -198,7 +198,7 @@ test('Integration test - phone number from order is visible in customer account
198198
lastName: mockOrder.billingAddress.lastName,
199199
address1: mockOrder.shipments[0].shippingAddress.address1,
200200
city: mockOrder.shipments[0].shippingAddress.city,
201-
phone: mockOrder.shipments[0].shippingAddress.phone,
201+
phone: mockOrder.billingAddress.phone,
202202
postalCode: mockOrder.shipments[0].shippingAddress.postalCode,
203203
stateCode: mockOrder.shipments[0].shippingAddress.stateCode,
204204
countryCode: mockOrder.shipments[0].shippingAddress.countryCode
@@ -245,7 +245,7 @@ test('Integration test - phone number from order is visible in customer account
245245
// and verifying the phone number is displayed in the UI, but that would require
246246
// additional setup of the Account page component and its dependencies.
247247

248-
// The key assertion is that the phone from the order's shipping address
249-
// is correctly saved to the customer's phoneHome field during registration
250-
expect(savedCustomerData.phoneHome).toBe(mockOrder.shipments[0].shippingAddress.phone)
248+
// The key assertion is that the phone from the order's billing address
249+
// is correctly saved to the customer's phoneHome field during registration
250+
expect(savedCustomerData.phoneHome).toBe(mockOrder.billingAddress.phone)
251251
})

0 commit comments

Comments
 (0)