Skip to content

Commit 68a9d95

Browse files
authored
Update "Add to cart" CTA to sentense case (#107610)
1 parent 22a1c1f commit 68a9d95

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

packages/domain-search/src/components/featured-search-results/test/item.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,11 @@ describe( 'FeaturedSearchResultsItem', () => {
593593

594594
await waitFor( () => screen.getByTitle( 'test-add-to-cart.com' ) );
595595

596-
const cta = screen.getByRole( 'button', { name: 'Add to Cart' } );
596+
const cta = screen.getByRole( 'button', { name: 'Add to cart' } );
597597

598598
expect( cta ).toBeInTheDocument();
599599
expect( cta ).toHaveClass( 'is-primary' );
600-
expect( cta ).toHaveTextContent( 'Add to Cart' );
600+
expect( cta ).toHaveTextContent( 'Add to cart' );
601601
} );
602602

603603
it( 'renders continue cta with text', async () => {

packages/domain-search/src/components/search-results/test/item.tsx

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

195195
await waitFor( () => screen.getByTitle( 'test-add-to-cart.com' ) );
196196

197-
const cta = screen.getByRole( 'button', { name: 'Add to Cart' } );
197+
const cta = screen.getByRole( 'button', { name: 'Add to cart' } );
198198

199199
expect( cta ).toBeInTheDocument();
200200
expect( cta ).toHaveClass( 'is-secondary' );

packages/domain-search/src/components/suggestion-cta/test/index.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { TestDomainSearchWithSuggestions } from '../../../test-helpers/renderer'
1313
import { DomainSuggestionsList } from '../../../ui';
1414

1515
describe( 'DomainSuggestionCTA', () => {
16-
describe( 'add to cart cta', () => {
16+
describe( 'Add to cart cta', () => {
1717
it( 'allows adding a domain to the cart', async () => {
1818
const user = userEvent.setup();
1919

@@ -54,7 +54,7 @@ describe( 'DomainSuggestionCTA', () => {
5454
</TestDomainSearchWithSuggestions>
5555
);
5656

57-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
57+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
5858

5959
expect( addToCartCta ).toBeInTheDocument();
6060

@@ -127,7 +127,7 @@ describe( 'DomainSuggestionCTA', () => {
127127
</TestDomainSearchWithSuggestions>
128128
);
129129

130-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
130+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
131131

132132
expect( addToCartCta ).toBeInTheDocument();
133133

@@ -193,7 +193,7 @@ describe( 'DomainSuggestionCTA', () => {
193193
</TestDomainSearchWithSuggestions>
194194
);
195195

196-
const [ dotCom, dotNet ] = await screen.findAllByRole( 'button', { name: 'Add to Cart' } );
196+
const [ dotCom, dotNet ] = await screen.findAllByRole( 'button', { name: 'Add to cart' } );
197197

198198
await user.click( dotCom );
199199

@@ -243,7 +243,7 @@ describe( 'DomainSuggestionCTA', () => {
243243
</TestDomainSearchWithSuggestions>
244244
);
245245

246-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
246+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
247247

248248
await user.click( addToCartCta );
249249

@@ -294,7 +294,7 @@ describe( 'DomainSuggestionCTA', () => {
294294
</TestDomainSearchWithSuggestions>
295295
);
296296

297-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
297+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
298298

299299
await user.click( addToCartCta );
300300

@@ -361,7 +361,7 @@ describe( 'DomainSuggestionCTA', () => {
361361
</TestDomainSearchWithSuggestions>
362362
);
363363

364-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
364+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
365365

366366
await user.click( addToCartCta );
367367

@@ -457,7 +457,7 @@ describe( 'DomainSuggestionCTA', () => {
457457
expect( continueCta ).toBeInTheDocument();
458458
expect( continueCta ).toBeEnabled();
459459

460-
const addToCartCta = screen.getByRole( 'button', { name: 'Add to Cart' } );
460+
const addToCartCta = screen.getByRole( 'button', { name: 'Add to cart' } );
461461

462462
expect( addToCartCta ).toBeInTheDocument();
463463
expect( addToCartCta ).toBeEnabled();
@@ -496,19 +496,19 @@ describe( 'DomainSuggestionCTA', () => {
496496
</TestDomainSearchWithSuggestions>
497497
);
498498

499-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
499+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
500500

501501
expect( addToCartCta ).toBeInTheDocument();
502502

503503
await user.click( addToCartCta );
504504

505505
await waitFor( () => {
506-
expect( screen.getByRole( 'button', { name: 'Add to Cart' } ) ).toHaveClass(
506+
expect( screen.getByRole( 'button', { name: 'Add to cart' } ) ).toHaveClass(
507507
'is-destructive'
508508
);
509509
} );
510510

511-
await user.hover( screen.getByRole( 'button', { name: 'Add to Cart' } ) );
511+
await user.hover( screen.getByRole( 'button', { name: 'Add to cart' } ) );
512512

513513
await waitFor( () => {
514514
expect( screen.getByText( 'Failed to fetch the availability' ) ).toBeInTheDocument();
@@ -536,14 +536,14 @@ describe( 'DomainSuggestionCTA', () => {
536536
</TestDomainSearchWithSuggestions>
537537
);
538538

539-
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to Cart' } );
539+
const addToCartCta = await screen.findByRole( 'button', { name: 'Add to cart' } );
540540

541541
expect( addToCartCta ).toBeInTheDocument();
542542

543543
await user.click( addToCartCta );
544544

545545
await waitFor( () => {
546-
expect( screen.getByRole( 'button', { name: 'Add to Cart' } ) ).toHaveClass(
546+
expect( screen.getByRole( 'button', { name: 'Add to cart' } ) ).toHaveClass(
547547
'is-destructive'
548548
);
549549
} );
@@ -556,7 +556,7 @@ describe( 'DomainSuggestionCTA', () => {
556556
} ),
557557
} );
558558

559-
await user.click( screen.getByRole( 'button', { name: 'Add to Cart' } ) );
559+
await user.click( screen.getByRole( 'button', { name: 'Add to cart' } ) );
560560

561561
await waitFor( () => {
562562
expect( screen.getByRole( 'button', { name: 'Continue' } ) ).toBeInTheDocument();
@@ -597,7 +597,7 @@ describe( 'DomainSuggestionCTA', () => {
597597
);
598598

599599
const [ errorCta, successCta ] = await screen.findAllByRole( 'button', {
600-
name: 'Add to Cart',
600+
name: 'Add to cart',
601601
} );
602602

603603
expect( errorCta ).toBeInTheDocument();
@@ -607,7 +607,7 @@ describe( 'DomainSuggestionCTA', () => {
607607

608608
await waitFor( () => {
609609
const [ errorCta, successCta ] = screen.getAllByRole( 'button', {
610-
name: 'Add to Cart',
610+
name: 'Add to cart',
611611
} );
612612

613613
expect( errorCta ).toHaveClass( 'is-destructive' );

packages/domain-search/src/ui/domain-suggestion-cta/error.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export const DomainSuggestionErrorCTA = ( {
3333
isDestructive
3434
variant="primary"
3535
__next40pxDefaultSize
36-
label={ __( 'Add to Cart' ) }
36+
label={ __( 'Add to cart' ) }
3737
onClick={ callback }
3838
icon={ warning }
3939
>
40-
{ listContext.isFeatured ? __( 'Add to Cart' ) : undefined }
40+
{ listContext.isFeatured ? __( 'Add to cart' ) : undefined }
4141
</Button>
4242
</Tooltip>
4343
</div>

packages/domain-search/src/ui/domain-suggestion-cta/primary.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export const DomainSuggestionPrimaryCTA = ( {
3737
icon={ icon ?? shoppingCartIcon }
3838
onClick={ onClick }
3939
href={ href }
40-
label={ label ?? __( 'Add to Cart' ) }
40+
label={ label ?? __( 'Add to cart' ) }
4141
disabled={ disabled }
4242
isBusy={ isBusy }
4343
>
44-
{ listContext.isFeatured ? children ?? __( 'Add to Cart' ) : undefined }
44+
{ listContext.isFeatured ? children ?? __( 'Add to cart' ) : undefined }
4545
</Button>
4646
);
4747
};

packages/domain-search/src/ui/domain-suggestion/featured.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const Default = () => {
3333
domain="example"
3434
tld="com"
3535
price={ <DomainSuggestionPrice salePrice="$97" price="$22" /> }
36-
cta={ <DomainSuggestionPrimaryCTA>Add to Cart</DomainSuggestionPrimaryCTA> }
36+
cta={ <DomainSuggestionPrimaryCTA>Add to cart</DomainSuggestionPrimaryCTA> }
3737
/>
3838
</StoryWrapper>
3939
);
@@ -57,7 +57,7 @@ export const Highlighted = () => {
5757
isHighlighted
5858
matchReasons={ [ 'Exact match', '.com is the most common extension' ] }
5959
price={ <DomainSuggestionPrice salePrice="$97" price="$22" /> }
60-
cta={ <DomainSuggestionPrimaryCTA>Add to Cart</DomainSuggestionPrimaryCTA> }
60+
cta={ <DomainSuggestionPrimaryCTA>Add to cart</DomainSuggestionPrimaryCTA> }
6161
/>
6262
</StoryWrapper>
6363
);

packages/domain-search/src/ui/domain-suggestions-list/index.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const Default = () => {
4545
<DomainSuggestionBadge variation="warning">Sale</DomainSuggestionBadge>
4646
</>
4747
}
48-
cta={ <DomainSuggestionPrimaryCTA>Add to Cart</DomainSuggestionPrimaryCTA> }
48+
cta={ <DomainSuggestionPrimaryCTA>Add to cart</DomainSuggestionPrimaryCTA> }
4949
/>
5050
) ) }
5151
</DomainSuggestionsList>

0 commit comments

Comments
 (0)