diff --git a/src/components/card/_macro.spec.js b/src/components/card/_macro.spec.js index 7760c89ecd..366f654e3e 100644 --- a/src/components/card/_macro.spec.js +++ b/src/components/card/_macro.spec.js @@ -11,7 +11,7 @@ import { EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH, } from './_test-examples'; -describe('macro: card', () => { +describe('FOR: card', () => { describe('mode: without image', () => { it('passes jest-axe checks', async () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITHOUT_IMAGE)); @@ -20,7 +20,7 @@ describe('macro: card', () => { expect(results).toHaveNoViolations(); }); - it('has the provided `title` text', () => { + it('has the provided title text', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITHOUT_IMAGE)); expect($('.ons-card__title').text().trim()).toBe('Example card title'); @@ -29,7 +29,7 @@ describe('macro: card', () => { it.each([ [1, 'h1'], [4, 'h4'], - ])('has the correct element type for the provided `headingLevel` (%i -> %s)', (headingLevel, expectedTitleTag) => { + ])('has the correct element type for the provided headingLevel (%i -> %s)', (headingLevel, expectedTitleTag) => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITHOUT_IMAGE, @@ -40,13 +40,13 @@ describe('macro: card', () => { expect($(`${expectedTitleTag}.ons-card__title`).text().trim()).toBe('Example card title'); }); - it('has the provided `text` accessible via the `textId` identifier', () => { + it('has the provided text accessible via the textId identifier', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITHOUT_IMAGE)); expect($('#example-text-id').text().trim()).toBe('Example card text.'); }); - it('renders the provided `itemsList` using the `list` component', () => { + it('renders the provided itemsList using the list component', () => { const faker = templateFaker(); const listsSpy = faker.spy('list'); @@ -61,7 +61,7 @@ describe('macro: card', () => { }); }); - it('outputs a hyperlink with the provided `url`', () => { + it('outputs a hyperlink with the provided url', () => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITHOUT_IMAGE, @@ -81,7 +81,7 @@ describe('macro: card', () => { expect(results).toHaveNoViolations(); }); - it('has the provided `title` text', () => { + it('has the provided title text', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_IMAGE)); expect($('.ons-card__title').text().trim()).toBe('Example card title'); @@ -90,7 +90,7 @@ describe('macro: card', () => { it.each([ [1, 'h1'], [4, 'h4'], - ])('has the correct element type for the provided `headingLevel` (%i -> %s)', (headingLevel, expectedTitleTag) => { + ])('has the correct element type for the provided headingLevel (%i -> %s)', (headingLevel, expectedTitleTag) => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITH_IMAGE, @@ -101,7 +101,7 @@ describe('macro: card', () => { expect($(`${expectedTitleTag}.ons-card__title`).text().trim()).toBe('Example card title'); }); - it('has the provided `text`', () => { + it('has the provided text', () => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITH_IMAGE, @@ -111,7 +111,7 @@ describe('macro: card', () => { expect($('#example-text-id').text().trim()).toBe('Example card text.'); }); - it('outputs a hyperlink with the provided `url`', () => { + it('outputs a hyperlink with the provided url', () => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITH_IMAGE, @@ -123,25 +123,25 @@ describe('macro: card', () => { }); describe('with a custom image', () => { - it('outputs an `img` element', () => { + it('outputs an img element', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_IMAGE)); expect($('.ons-card__image')[0].tagName).toBe('img'); }); - it('outputs an `img` element with the expected `srcset`', () => { + it('outputs an img element with the expected srcset', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_IMAGE)); expect($('.ons-card__image').attr('srcset')).toBe('example-small.png 1x, example-large.png 2x'); }); - it('outputs an `img` element with the expected `src`', () => { + it('outputs an img element with the expected src', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_IMAGE)); expect($('.ons-card__image').attr('src')).toBe('example-small.png'); }); - it('outputs an `img` element with the expected alt text', () => { + it('outputs an img element with the expected alt text', () => { const $ = cheerio.load( renderComponent('card', { ...EXAMPLE_CARD_WITH_IMAGE, @@ -154,39 +154,39 @@ describe('macro: card', () => { }); describe('with a default placeholder image', () => { - it('outputs an `img` element', () => { + it('outputs an img element', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE)); expect($('.ons-card__image')[0].tagName).toBe('img'); }); - it('outputs an `img` element with the expected `srcset`', () => { + it('outputs an img element with the expected srcset', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE)); expect($('.ons-card__image').attr('srcset')).toBe('/img/small/placeholder-card.png 1x, /img/large/placeholder-card.png 2x'); }); - it('outputs an `img` element with the expected `src`', () => { + it('outputs an img element with the expected src', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE)); expect($('.ons-card__image').attr('src')).toBe('/img/small/placeholder-card.png'); }); - it('outputs an `img` element with the expected empty alt text', () => { + it('outputs an img element with the expected empty alt text', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE)); expect($('.ons-card__image').attr('alt')).toBe(''); }); }); - describe('with a default placeholder image with `placeholderURL`', () => { - it('outputs an `img` element', () => { + describe('with a default placeholder image with placeholderURL', () => { + it('outputs an img element', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH)); expect($('.ons-card__image')[0].tagName).toBe('img'); }); - it('outputs an `img` element with the expected `srcset`', () => { + it('outputs an img element with the expected srcset', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH)); expect($('.ons-card__image').attr('srcset')).toBe( @@ -194,13 +194,13 @@ describe('macro: card', () => { ); }); - it('outputs an `img` element with the expected `src`', () => { + it('outputs an img element with the expected src', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH)); expect($('.ons-card__image').attr('src')).toBe('/placeholder-image-url/img/small/placeholder-card.png'); }); - it('outputs an `img` element with the expected empty alt text', () => { + it('outputs an img element with the expected empty alt text', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH)); expect($('.ons-card__image').attr('alt')).toBe('');