Skip to content

Commit 3276340

Browse files
@W-18963026 BOPIS approved label updates (#2726)
1 parent 03cba9f commit 3276340

File tree

17 files changed

+123
-111
lines changed

17 files changed

+123
-111
lines changed

packages/template-retail-react-app/app/components/product-view/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ const ProductView = forwardRef(
716716
}
717717
>
718718
<FormattedMessage
719-
defaultMessage="Pickup in Store"
719+
defaultMessage="Pick Up in Store"
720720
id="product_view.label.pickup_in_store"
721721
/>
722722
</Radio>
@@ -739,7 +739,7 @@ const ProductView = forwardRef(
739739
{
740740
id: 'product_view.status.in_stock_at_store',
741741
defaultMessage:
742-
'In Stock at {storeName}'
742+
'In stock at {storeName}'
743743
},
744744
{
745745
storeName: (
@@ -789,7 +789,7 @@ const ProductView = forwardRef(
789789
data-testid="pickup-select-store-msg"
790790
>
791791
<FormattedMessage
792-
defaultMessage="Pickup in "
792+
defaultMessage="Pick up in "
793793
id="product_view.label.pickup_in_select_store_prefix"
794794
/>{' '}
795795
<Link

packages/template-retail-react-app/app/components/product-view/index.test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ test('renders a product set properly - parent item', () => {
227227
.filter(
228228
(rg) =>
229229
!rg.textContent.includes('Ship to Address') &&
230-
!rg.textContent.includes('Pickup in Store')
230+
!rg.textContent.includes('Pick Up in Store')
231231
)
232232
const quantityPicker = screen.queryByRole('spinbutton', {name: /quantity/i})
233233

@@ -257,7 +257,7 @@ test('renders a product set properly - child item', () => {
257257
.filter(
258258
(rg) =>
259259
!rg.textContent.includes('Ship to Address') &&
260-
!rg.textContent.includes('Pickup in Store')
260+
!rg.textContent.includes('Pick Up in Store')
261261
)
262262
const quantityPicker = screen.getByRole('spinbutton', {name: /quantity/i})
263263
const fromLabels = screen.queryAllByText(/from/i)
@@ -361,7 +361,7 @@ test('renders a product bundle properly - parent item', () => {
361361
.filter(
362362
(rg) =>
363363
!rg.textContent.includes('Ship to Address') &&
364-
!rg.textContent.includes('Pickup in Store')
364+
!rg.textContent.includes('Pick Up in Store')
365365
)
366366

367367
// What should exist:
@@ -392,7 +392,7 @@ test('renders a product bundle properly - child item', () => {
392392
.filter(
393393
(rg) =>
394394
!rg.textContent.includes('Ship to Address') &&
395-
!rg.textContent.includes('Pickup in Store')
395+
!rg.textContent.includes('Pick Up in Store')
396396
)
397397
const quantityPicker = screen.queryByRole('spinbutton', {name: /quantity:/i})
398398

@@ -405,7 +405,7 @@ test('renders a product bundle properly - child item', () => {
405405
expect(quantityPicker).toBeNull()
406406
})
407407

408-
test('Pickup in store radio is enabled when selected store is set', async () => {
408+
test('Pick up in store radio is enabled when selected store is set', async () => {
409409
// Ensure the product has inventory data for the store and is in stock
410410
const mockProduct = {
411411
...mockProductDetail,
@@ -415,19 +415,19 @@ test('Pickup in store radio is enabled when selected store is set', async () =>
415415
renderWithProviders(<MockComponent product={mockProduct} />)
416416

417417
// Assert: Radio is enabled
418-
const pickupRadio = await screen.findByRole('radio', {name: /pickup in store/i})
418+
const pickupRadio = await screen.findByRole('radio', {name: /pick up in store/i})
419419
expect(pickupRadio).toBeEnabled()
420420
})
421421

422-
test('Pickup in store radio is disabled when inventoryId is NOT present in localStorage', async () => {
422+
test('Pick up in store radio is disabled when inventoryId is NOT present in selected store', async () => {
423423
renderWithProviders(<MockComponent product={mockProductDetail} />)
424424

425425
// Assert: Radio is disabled
426-
const pickupRadio = await screen.findByRole('radio', {name: /pickup in store/i})
426+
const pickupRadio = await screen.findByRole('radio', {name: /pick up in store/i})
427427
expect(pickupRadio).toBeDisabled()
428428
})
429429

430-
test('Pickup in store radio is disabled when inventoryId is present but product is out of stock', async () => {
430+
test('Pick up in store radio is disabled when inventoryId is present but product is out of stock', async () => {
431431
const user = userEvent.setup()
432432

433433
// Product inventory is not orderable
@@ -438,14 +438,14 @@ test('Pickup in store radio is disabled when inventoryId is present but product
438438

439439
renderWithProviders(<MockComponent product={mockProduct} />)
440440

441-
const pickupRadio = await screen.findByRole('radio', {name: /pickup in store/i})
441+
const pickupRadio = await screen.findByRole('radio', {name: /pick up in store/i})
442442
// Chakra UI does not set a semantic disabled attribute, so we test for unclickability
443443
expect(pickupRadio).not.toBeChecked()
444444
await user.click(pickupRadio)
445445
expect(pickupRadio).not.toBeChecked()
446446
})
447447

448-
test('shows "Pickup in Select Store" label when pickup is disabled due to no store/inventoryId', async () => {
448+
test('shows "Pick up in Select Store" label when pickup is disabled due to no store/inventoryId', async () => {
449449
useSelectedStore.mockReturnValue({
450450
selectedStore: null,
451451
isLoading: false,
@@ -457,7 +457,7 @@ test('shows "Pickup in Select Store" label when pickup is disabled due to no sto
457457

458458
const label = await screen.findByTestId('pickup-select-store-msg')
459459
expect(label).toBeInTheDocument()
460-
expect(label).toHaveTextContent(/Pickup in/i)
460+
expect(label).toHaveTextContent(/Pick up in/i)
461461
const button = label.querySelector('button')
462462
expect(button).toBeInTheDocument()
463463
expect(button).toHaveTextContent(/Select Store/i)
@@ -466,14 +466,14 @@ test('shows "Pickup in Select Store" label when pickup is disabled due to no sto
466466
describe('ProductView stock status messages', () => {
467467
const storeName = 'Test Store'
468468

469-
test('shows "In Stock at {storeName}" when store has inventory', async () => {
469+
test('shows "In stock at {storeName}" when store has inventory', async () => {
470470
const mockProduct = {
471471
...mockProductDetail,
472472
inventories: [{id: mockStoreData.inventoryId, orderable: true, stockLevel: 10}],
473473
name: 'Test Product'
474474
}
475475
renderWithProviders(<MockComponent product={mockProduct} />)
476-
const msg = await screen.findByText(/In Stock at/i)
476+
const msg = await screen.findByText(/In stock at/i)
477477
expect(msg).toBeInTheDocument()
478478
expect(msg).toHaveTextContent(storeName)
479479
// Store name should be a button
@@ -508,7 +508,7 @@ describe('ProductView showDeliveryOptions property', () => {
508508
// Delivery options should be visible
509509
expect(screen.getByText(/Delivery:/i)).toBeInTheDocument()
510510
expect(screen.getByRole('radio', {name: /ship to address/i})).toBeInTheDocument()
511-
expect(screen.getByRole('radio', {name: /pickup in store/i})).toBeInTheDocument()
511+
expect(screen.getByRole('radio', {name: /pick up in store/i})).toBeInTheDocument()
512512
})
513513

514514
test('hides delivery options when showDeliveryOptions is false', async () => {
@@ -519,7 +519,7 @@ describe('ProductView showDeliveryOptions property', () => {
519519
// Delivery options should not be visible
520520
expect(screen.queryByText(/Delivery:/i)).not.toBeInTheDocument()
521521
expect(screen.queryByRole('radio', {name: /ship to address/i})).not.toBeInTheDocument()
522-
expect(screen.queryByRole('radio', {name: /pickup in store/i})).not.toBeInTheDocument()
522+
expect(screen.queryByRole('radio', {name: /pick up in store/i})).not.toBeInTheDocument()
523523
expect(screen.queryByTestId('store-stock-status-msg')).not.toBeInTheDocument()
524524
expect(screen.queryByTestId('pickup-select-store-msg')).not.toBeInTheDocument()
525525
})
@@ -530,7 +530,7 @@ describe('ProductView showDeliveryOptions property', () => {
530530
// Delivery options should be visible by default
531531
expect(screen.getByText(/Delivery:/i)).toBeInTheDocument()
532532
expect(screen.getByRole('radio', {name: /ship to address/i})).toBeInTheDocument()
533-
expect(screen.getByRole('radio', {name: /pickup in store/i})).toBeInTheDocument()
533+
expect(screen.getByRole('radio', {name: /pick up in store/i})).toBeInTheDocument()
534534
})
535535
})
536536
test('renders "Add to Cart" and "Add to Wishlist" buttons in French', async () => {

packages/template-retail-react-app/app/components/store-locator/form.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const StoreLocatorForm = () => {
9696
rules={{
9797
required: intl.formatMessage({
9898
id: 'store_locator.error.please_select_a_country',
99-
defaultMessage: 'Please select a country.'
99+
defaultMessage: 'Select a country.'
100100
})
101101
}}
102102
render={({field}) => {
@@ -145,7 +145,7 @@ export const StoreLocatorForm = () => {
145145
rules={{
146146
required: intl.formatMessage({
147147
id: 'store_locator.error.please_enter_a_postal_code',
148-
defaultMessage: 'Please enter a postal code.'
148+
defaultMessage: 'Enter a postal code.'
149149
})
150150
}}
151151
render={({field}) => {
@@ -213,7 +213,7 @@ export const StoreLocatorForm = () => {
213213
>
214214
{intl.formatMessage({
215215
id: 'store_locator.error.agree_to_share_your_location',
216-
defaultMessage: 'Please agree to share your location'
216+
defaultMessage: 'To use your location, enable location sharing.'
217217
})}
218218
</FormErrorMessage>
219219
</FormControl>

packages/template-retail-react-app/app/components/store-locator/form.test.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ describe('StoreLocatorForm', () => {
6666
'store_locator.action.find': 'Find',
6767
'store_locator.description.or': 'Or',
6868
'store_locator.action.use_my_location': 'Use My Location',
69-
'store_locator.error.please_enter_a_postal_code': 'Please enter a postal code.',
70-
'store_locator.error.please_select_a_country': 'Please select a country.',
71-
'store_locator.error.agree_to_share_your_location': 'Please agree to share your location'
69+
'store_locator.error.please_enter_a_postal_code': 'Enter a postal code.',
70+
'store_locator.error.please_select_a_country': 'Select a country.',
71+
'store_locator.error.agree_to_share_your_location':
72+
'To use your location, enable location sharing.'
7273
}
7374

7475
const TestWrapper = ({children}) => (
@@ -164,7 +165,7 @@ describe('StoreLocatorForm', () => {
164165
await user.click(findButton)
165166

166167
await waitFor(() => {
167-
const errorMessage = screen.getByText('Please enter a postal code.')
168+
const errorMessage = screen.getByText('Enter a postal code.')
168169
expect(errorMessage).toBeInTheDocument()
169170
})
170171
})

packages/template-retail-react-app/app/components/store-locator/list.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ export const StoreLocatorList = () => {
5050
if (hasItemsInBasket) {
5151
return intl.formatMessage({
5252
id: 'store_locator.error.items_in_basket',
53-
defaultMessage:
54-
'Sorry, you have items in your basket. Please remove them to change the selected store.'
53+
defaultMessage: 'To change your selected store, remove all items from your cart.'
5554
})
5655
}
5756

@@ -68,7 +67,7 @@ export const StoreLocatorList = () => {
6867
{
6968
id: 'store_locator.description.viewing_near_postal_code',
7069
defaultMessage:
71-
'Viewing stores within {distance}{distanceUnit} of {postalCode} in {countryName}'
70+
'Viewing stores within {distance} {distanceUnit} of {postalCode} in {countryName}'
7271
},
7372
{
7473
distance: config.radius,

packages/template-retail-react-app/app/components/store-locator/list.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('StoreLocatorList', () => {
127127

128128
renderWithProviders(<StoreLocatorList />)
129129
expect(
130-
screen.getByText(/Viewing stores within 10mi of 02108 in United States/)
130+
screen.getByText(/Viewing stores within 10 mi of 02108 in United States/)
131131
).toBeTruthy()
132132
})
133133

packages/template-retail-react-app/app/pages/cart/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ const Cart = () => {
615615
{isPickupOrder ? (
616616
<Text fontWeight="bold">
617617
<FormattedMessage
618-
defaultMessage="Pickup in Store ({storeName})"
618+
defaultMessage="Pick Up in Store ({storeName})"
619619
id="cart.order_type.pickup_in_store"
620620
values={{
621621
storeName

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const CheckoutConfirmation = () => {
299299
) : (
300300
<Text>
301301
<FormattedMessage
302-
defaultMessage="Store information not available"
302+
defaultMessage="Store information isn't available"
303303
id="checkout_confirmation.message.store_info_unavailable"
304304
/>
305305
</Text>

packages/template-retail-react-app/app/pages/product-detail/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const ProductDetail = () => {
382382
formatMessage({
383383
id: 'product_view.error.select_ship_to_address',
384384
defaultMessage:
385-
"Please select 'Ship to Address' to match the shipping method for your other items."
385+
"Select 'Ship to Address' to match the delivery method for the items in your cart."
386386
})
387387
)
388388
}
@@ -391,7 +391,7 @@ const ProductDetail = () => {
391391
formatMessage({
392392
id: 'product_view.error.select_pickup_in_store',
393393
defaultMessage:
394-
"Please select 'Pickup in Store' to match the shipping method for your other items."
394+
"Select 'Pick Up in Store' to match the delivery method for the items in your cart."
395395
})
396396
)
397397
}
@@ -508,7 +508,7 @@ const ProductDetail = () => {
508508
formatMessage({
509509
id: 'product_view.error.select_ship_to_address',
510510
defaultMessage:
511-
"Please select 'Ship to Address' to match the shipping method for your other items."
511+
"Select 'Ship to Address' to match the delivery method for the items in your cart."
512512
})
513513
)
514514
} else if (
@@ -520,7 +520,7 @@ const ProductDetail = () => {
520520
formatMessage({
521521
id: 'product_view.error.select_pickup_in_store',
522522
defaultMessage:
523-
"Please select 'Pickup in Store' to match the shipping method for your other items."
523+
"Select 'Pick Up in Store' to match the delivery method for the items in your cart."
524524
})
525525
)
526526
}

packages/template-retail-react-app/app/pages/product-detail/index.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ describe('Delivery Options Restrictions', () => {
595595
await waitFor(() => {
596596
expect(screen.getByRole('link', {name: /mens/i})).toBeInTheDocument()
597597
})
598-
// Select "Pickup in Store"
599-
const pickupLabel = await screen.findByLabelText(/Pickup in Store/i)
598+
// Select "Pick Up in Store"
599+
const pickupLabel = await screen.findByLabelText(/Pick Up in Store/i)
600600
fireEvent.click(pickupLabel)
601601

602602
// Click Add to Cart
@@ -606,7 +606,7 @@ describe('Delivery Options Restrictions', () => {
606606
await waitFor(() => {
607607
expect(
608608
screen.getByText(
609-
"Please select 'Ship to Address' to match the shipping method for your other items."
609+
"Select 'Ship to Address' to match the delivery method for the items in your cart."
610610
)
611611
).toBeInTheDocument()
612612
})
@@ -711,8 +711,8 @@ describe('Delivery Options Restrictions', () => {
711711
expect(screen.getByRole('link', {name: /mens/i})).toBeInTheDocument()
712712
})
713713

714-
// Select "Pickup in Store"
715-
const pickupLabel = await screen.findByLabelText(/Pickup in Store/i)
714+
// Select "Pick Up in Store"
715+
const pickupLabel = await screen.findByLabelText(/Pick Up in Store/i)
716716
fireEvent.click(pickupLabel)
717717

718718
// Click Add to Cart
@@ -722,7 +722,7 @@ describe('Delivery Options Restrictions', () => {
722722
await waitFor(() => {
723723
expect(
724724
screen.getByText(
725-
"Please select 'Ship to Address' to match the shipping method for your other items."
725+
"Select 'Ship to Address' to match the delivery method for the items in your cart."
726726
)
727727
).toBeInTheDocument()
728728
})
@@ -776,7 +776,7 @@ describe('Delivery Options Restrictions', () => {
776776
await waitFor(() => {
777777
expect(
778778
screen.getByText(
779-
"Please select 'Pickup in Store' to match the shipping method for your other items."
779+
"Select 'Pick Up in Store' to match the delivery method for the items in your cart."
780780
)
781781
).toBeInTheDocument()
782782
})
@@ -813,7 +813,7 @@ test('fetches product with inventoryIds when store is selected', async () => {
813813
expect(inventoryIdsParam).toBe(inventoryId)
814814
})
815815

816-
test('Add to Cart (Pickup in Store) includes inventoryId for the selected variant', async () => {
816+
test('Add to Cart (Pick Up in Store) includes inventoryId for the selected variant', async () => {
817817
// Mock useSelectedStore to return a store with inventoryId
818818
const inventoryId = 'inventory_m_store_store1'
819819
mockUseSelectedStore.mockImplementation(() => ({
@@ -858,8 +858,8 @@ test('Add to Cart (Pickup in Store) includes inventoryId for the selected varian
858858
// Wait for page to load
859859
expect(await screen.findByTestId('product-details-page')).toBeInTheDocument()
860860

861-
// Select "Pickup in Store"
862-
const pickupLabel = await screen.findByLabelText(/Pickup in Store/i)
861+
// Select "Pick Up in Store"
862+
const pickupLabel = await screen.findByLabelText(/Pick Up in Store/i)
863863
fireEvent.click(pickupLabel)
864864

865865
// Click Add to Cart

0 commit comments

Comments
 (0)