diff --git a/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx b/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx index 3a739793182..e68c2ddc525 100644 --- a/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx +++ b/polaris-react/src/components/AccountConnection/AccountConnection.stories.tsx @@ -19,8 +19,10 @@ export function Default() { const terms = connected ? null : (

By clicking Connect, you agree to accept Sample App’s{' '} - terms and conditions. You’ll pay a - commission rate of 15% on sales made through Sample App. + + terms and conditions + + . You’ll pay a commission rate of 15% on sales made through Sample App.

); diff --git a/polaris-react/src/components/Banner/Banner.stories.tsx b/polaris-react/src/components/Banner/Banner.stories.tsx index ecae7174d21..db5bc3da574 100644 --- a/polaris-react/src/components/Banner/Banner.stories.tsx +++ b/polaris-react/src/components/Banner/Banner.stories.tsx @@ -30,7 +30,9 @@ export function Dismissible() { {}}>

Use your finance report to get detailed information about your business.{' '} - Let us know what you think + + Let us know what you think +

); @@ -104,8 +106,10 @@ export function Critical() { >

Before fulfilling this order or capturing payment, please{' '} - review the Risk Analysis and determine if this order - is fraudulent. + + review the Risk Analysis + {' '} + and determine if this order is fraudulent.

); @@ -180,7 +184,10 @@ export function InACard() { {}}>

Use your finance report to get detailed information about your - business. Let us know what you think + business.{' '} + + Let us know what you think +

@@ -198,7 +205,7 @@ export function WithEndJustifiedContent() { Deployment failed in 5min - + Logs diff --git a/polaris-react/src/components/Collapsible/Collapsible.stories.tsx b/polaris-react/src/components/Collapsible/Collapsible.stories.tsx index 0473242b50a..d4b351c701d 100644 --- a/polaris-react/src/components/Collapsible/Collapsible.stories.tsx +++ b/polaris-react/src/components/Collapsible/Collapsible.stories.tsx @@ -44,7 +44,7 @@ export function Default() { have shown an interest in your store. Reach out to them with exclusive offers or updates about your products.

- Test link + Test link diff --git a/polaris-react/src/components/DataTable/DataTable.stories.tsx b/polaris-react/src/components/DataTable/DataTable.stories.tsx index 0f0558d20cf..de4b506c0a4 100644 --- a/polaris-react/src/components/DataTable/DataTable.stories.tsx +++ b/polaris-react/src/components/DataTable/DataTable.stories.tsx @@ -239,11 +239,7 @@ export function WithTotalsInFooter() { export function WithRowHeadingLinks() { const rows = [ [ - + Emerald Silk Gown , '$875.00', @@ -252,11 +248,7 @@ export function WithRowHeadingLinks() { '$122,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -265,11 +257,7 @@ export function WithRowHeadingLinks() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -304,11 +292,7 @@ export function WithAllOfItsElements() { const initiallySortedRows = [ [ - + Emerald Silk Gown , '$875.00', @@ -317,11 +301,7 @@ export function WithAllOfItsElements() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -330,11 +310,7 @@ export function WithAllOfItsElements() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -534,11 +510,7 @@ export function WithFixedColumns() { export function WithIncreasedDensityAndZebraStriping() { const rows = [ [ - + Emerald Silk Gown , '$875.00', @@ -547,11 +519,7 @@ export function WithIncreasedDensityAndZebraStriping() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -560,11 +528,7 @@ export function WithIncreasedDensityAndZebraStriping() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -608,11 +572,7 @@ export function WithIncreasedDensityAndZebraStriping() { export function WithStickyHeaderEnabled() { const rows = [ [ - + Emerald Silk Gown , '$875.00', @@ -621,11 +581,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -634,11 +590,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -647,11 +599,7 @@ export function WithStickyHeaderEnabled() { '$14,240.00', ], [ - + Emerald Silk Gown , '$875.00', @@ -660,11 +608,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -673,11 +617,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -686,11 +626,7 @@ export function WithStickyHeaderEnabled() { '$14,240.00', ], [ - + Emerald Silk Gown , '$875.00', @@ -699,11 +635,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -712,11 +644,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -725,11 +653,7 @@ export function WithStickyHeaderEnabled() { '$14,240.00', ], [ - + Emerald Silk Gown , '$875.00', @@ -738,11 +662,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -751,11 +671,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -764,11 +680,7 @@ export function WithStickyHeaderEnabled() { '$14,240.00', ], [ - + Emerald Silk Gown , '$875.00', @@ -777,11 +689,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -790,11 +698,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', @@ -803,11 +707,7 @@ export function WithStickyHeaderEnabled() { '$14,240.00', ], [ - + Emerald Silk Gown , '$875.00', @@ -816,11 +716,7 @@ export function WithStickyHeaderEnabled() { '$121,500.00', ], [ - + Mauve Cashmere Scarf , '$230.00', @@ -829,11 +725,7 @@ export function WithStickyHeaderEnabled() { '$19,090.00', ], [ - + Navy Merino Wool Blazer with khaki chinos and yellow belt , '$445.00', diff --git a/polaris-react/src/components/EmptyState/EmptyState.stories.tsx b/polaris-react/src/components/EmptyState/EmptyState.stories.tsx index 170c8d730d8..4f47c5fff61 100644 --- a/polaris-react/src/components/EmptyState/EmptyState.stories.tsx +++ b/polaris-react/src/components/EmptyState/EmptyState.stories.tsx @@ -38,7 +38,7 @@ export function WithSubduedFooterContext() {

If you don’t want to add a transfer, you can import your inventory from{' '} - + settings . diff --git a/polaris-react/src/components/FooterHelp/FooterHelp.stories.tsx b/polaris-react/src/components/FooterHelp/FooterHelp.stories.tsx index 4e3b89148b1..ba3ca4cf11b 100644 --- a/polaris-react/src/components/FooterHelp/FooterHelp.stories.tsx +++ b/polaris-react/src/components/FooterHelp/FooterHelp.stories.tsx @@ -10,7 +10,10 @@ export function Default() { return ( Learn more about{' '} - + fulfilling orders diff --git a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx index b8325693eb6..4aa913edb07 100644 --- a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx +++ b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx @@ -1405,7 +1405,7 @@ export function WithRowNavigationLink() { console.log(`Clicked ${name}`)} > diff --git a/polaris-react/src/components/IndexTable/components/Row/tests/Row.test.tsx b/polaris-react/src/components/IndexTable/components/Row/tests/Row.test.tsx index b823b47d496..6d224b7dc17 100644 --- a/polaris-react/src/components/IndexTable/components/Row/tests/Row.test.tsx +++ b/polaris-react/src/components/IndexTable/components/Row/tests/Row.test.tsx @@ -225,7 +225,7 @@ describe('', () => { }); it.each([ - ['', () => ], + ['', () => ], [' - ); - }} - + return href ? ( + + {children} + + ) : ( + ); } diff --git a/polaris-react/src/components/Link/tests/Link.test.tsx b/polaris-react/src/components/Link/tests/Link.test.tsx index 4f67a6c7b17..60e947d1aaa 100644 --- a/polaris-react/src/components/Link/tests/Link.test.tsx +++ b/polaris-react/src/components/Link/tests/Link.test.tsx @@ -1,14 +1,13 @@ import React from 'react'; import {mountWithApp} from 'tests/utilities'; -import {Banner} from '../../Banner'; import {UnstyledLink} from '../../UnstyledLink'; import {Link} from '../Link'; describe('', () => { it('calls onClick when clicking', () => { const spy = jest.fn(); - const link = mountWithApp(); + const link = mountWithApp(); link.find('a')!.trigger('onClick'); expect(spy).toHaveBeenCalled(); }); @@ -19,7 +18,7 @@ describe('', () => { }); it('renders an anchor if a url is provided', () => { - const link = mountWithApp(); + const link = mountWithApp(); expect(link).toContainReactComponentTimes('a', 1); }); @@ -32,41 +31,15 @@ describe('', () => { it('is passed down to an underlying UnstyledLink', () => { const id = 'MyID'; - const link = mountWithApp(); + const link = mountWithApp(); expect(link).toContainReactComponent(UnstyledLink, {id}); }); }); - describe('external link', () => { - it('adds target blank and noopener noreferrer if external', () => { - const link = mountWithApp( - - Shopify Help Center - , - ); - const htmlLink = link.find('a'); - - expect(htmlLink?.props.target).toBe('_blank'); - expect(htmlLink?.props.rel).toBe('noopener noreferrer'); - }); - }); - describe('target', () => { it('adds target blank and noopener noreferrer', () => { const link = mountWithApp( - - Shopify Help Center - , - ); - const htmlLink = link.find('a'); - - expect(htmlLink?.props.target).toBe('_blank'); - expect(htmlLink?.props.rel).toBe('noopener noreferrer'); - }); - - it('does not override external prop', () => { - const link = mountWithApp( - + Shopify Help Center , ); @@ -78,45 +51,23 @@ describe('', () => { }); describe('monochrome link', () => { - it('outputs a monochrome unstyled link if rendered within a banner', () => { + it('outputs a monochrome link', () => { const link = mountWithApp( - - Some content - , + + Some content + , ); expect(link).toContainReactComponent(UnstyledLink, { - className: expect.stringContaining('monochrome'), - }); - }); - - it('does not output a monochrome unstyled link if it is not rendered within a banner', () => { - const link = mountWithApp( - Some content, - ); - - expect(link).not.toContainReactComponent(UnstyledLink, { - className: expect.stringContaining('monochrome'), + className: expect.stringContaining('inherit'), }); }); - it('outputs a monochrome button if rendered within a banner', () => { - const button = mountWithApp( - - Some content - , - ); + it('outputs a monochrome button', () => { + const button = mountWithApp(Some content); expect(button).toContainReactComponent('button', { - className: expect.stringContaining('monochrome'), - }); - }); - - it('does not output a monochrome button if it is not rendered within a banner', () => { - const button = mountWithApp(Some content); - - expect(button).not.toContainReactComponent('button', { - className: expect.stringContaining('monochrome'), + className: expect.stringContaining('inherit'), }); }); }); @@ -138,7 +89,7 @@ describe('', () => { const link = mountWithApp( , ); @@ -149,12 +100,12 @@ describe('', () => { }); }); - describe('removesUnderline', () => { - it('adds removeUnderline class to the link', () => { - const link = mountWithApp(Test); + describe('underline always', () => { + it('adds underline class to the link', () => { + const link = mountWithApp(Test); expect(link).toContainReactComponent('button', { - className: expect.stringContaining('removeUnderline'), + className: expect.stringContaining('underline'), }); }); }); @@ -162,7 +113,7 @@ describe('', () => { describe('dataPrimaryLink', () => { it('adds data-primary-link attribute to the link', () => { const link = mountWithApp( - + Test , ); @@ -182,4 +133,17 @@ describe('', () => { expect(link).toContainReactComponent('button', selector); }); }); + + describe('language', () => { + it('language is passed down', () => { + const link = mountWithApp( + + Centro assistenza Shopify + , + ); + const htmlLink = link.find('a'); + + expect(htmlLink?.props.lang).toBe('it'); + }); + }); }); diff --git a/polaris-react/src/components/Popover/Popover.stories.tsx b/polaris-react/src/components/Popover/Popover.stories.tsx index 33a9d22a6cd..24c09114b12 100644 --- a/polaris-react/src/components/Popover/Popover.stories.tsx +++ b/polaris-react/src/components/Popover/Popover.stories.tsx @@ -433,7 +433,7 @@ export function WithSearchableListbox() { borderBottom: '1px dashed var(--p-color-border)', }} > - + {segments[selectedSegmentIndex].label} diff --git a/polaris-react/src/components/Select/Select.stories.tsx b/polaris-react/src/components/Select/Select.stories.tsx index 84d37669da1..d84f1d2cdb9 100644 --- a/polaris-react/src/components/Select/Select.stories.tsx +++ b/polaris-react/src/components/Select/Select.stories.tsx @@ -173,7 +173,9 @@ export function WithSeparateValidationError() {

{`${weightError}${unitError} is required when weight based shipping rates are enabled. `} - Manage shipping + + Manage shipping +

); diff --git a/polaris-react/src/components/TopBar/components/Menu/components/Message/Message.tsx b/polaris-react/src/components/TopBar/components/Menu/components/Message/Message.tsx index df8a4a7e6da..6c2dc21aebf 100644 --- a/polaris-react/src/components/TopBar/components/Menu/components/Message/Message.tsx +++ b/polaris-react/src/components/TopBar/components/Menu/components/Message/Message.tsx @@ -46,7 +46,7 @@ export function Message({

{description}

- {linkContent} + {linkContent}