From e520cf25b74afd92b9202072278cbdd97022d15b Mon Sep 17 00:00:00 2001 From: Precious Onyenaucheya Date: Mon, 29 May 2023 21:11:44 +0100 Subject: [PATCH 1/4] fix name discrepancy --- .../access-code/example-access-code-error.njk | 2 +- src/components/card/_macro.njk | 2 +- src/components/footer/_macro.njk | 2 +- src/components/{lists => list}/_list.scss | 0 .../{lists => list}/_macro-options.md | 0 src/components/{lists => list}/_macro.njk | 0 src/components/{lists => list}/_macro.spec.js | 80 +++++++++---------- .../example-panel-with-error-summary.njk | 2 +- src/components/question/_macro-options.md | 10 +-- src/components/question/_macro.njk | 2 +- src/components/related-content/_macro.njk | 2 +- .../example-related-content-general.njk | 2 +- .../example-relationships-error.njk | 2 +- src/components/share-page/_macro.njk | 2 +- src/components/timeline/_macro.njk | 2 +- src/foundations/lists/example-bare-list.njk | 2 +- .../lists/example-bulleted-list.njk | 2 +- src/foundations/lists/example-dashed-list.njk | 2 +- ...le-inline-list-with-social-icon-prefix.njk | 2 +- src/foundations/lists/example-inline-list.njk | 2 +- .../lists/example-list-with-icon-prefix.njk | 2 +- .../lists/example-list-with-icon-suffix.njk | 2 +- .../lists/example-numbered-list.njk | 2 +- .../lists/example-prefixed-list.njk | 2 +- .../lists/example-suffixed-list.njk | 2 +- .../example-address-input-manual-error.njk | 2 +- .../correct-errors/example-error-summary.njk | 2 +- .../example-errors-proto-errors.njk | 2 +- .../example-timed-out-error-not-signed-in.njk | 2 +- .../example-timed-out-error.njk | 2 +- .../feedback/example-feedback-form-errors.njk | 2 +- src/patterns/guide/example-guide-overview.njk | 2 +- src/patterns/guide/example-guide-rtl.njk | 2 +- src/patterns/guide/example-guide.njk | 2 +- .../hub-and-spoke/example-spoke-start.njk | 2 +- src/patterns/news/example-article.njk | 2 +- src/patterns/news/example-landing.njk | 2 +- .../send-a-web-form/example-errors.njk | 2 +- src/scss/main.scss | 2 +- 39 files changed, 79 insertions(+), 79 deletions(-) rename src/components/{lists => list}/_list.scss (100%) rename src/components/{lists => list}/_macro-options.md (100%) rename src/components/{lists => list}/_macro.njk (100%) rename src/components/{lists => list}/_macro.spec.js (91%) diff --git a/src/components/access-code/example-access-code-error.njk b/src/components/access-code/example-access-code-error.njk index 279de9b6fb..f80c6ed145 100644 --- a/src/components/access-code/example-access-code-error.njk +++ b/src/components/access-code/example-access-code-error.njk @@ -20,7 +20,7 @@ layout: ~ }) %} - {% from "components/lists/_macro.njk" import onsList %} + {% from "components/list/_macro.njk" import onsList %} {{ onsList({ "element": "ol", diff --git a/src/components/card/_macro.njk b/src/components/card/_macro.njk index e7d30b84f7..5c54aae005 100644 --- a/src/components/card/_macro.njk +++ b/src/components/card/_macro.njk @@ -1,6 +1,6 @@ {%- macro onsCard(params) -%} - {% from "components/lists/_macro.njk" import onsList %} + {% from "components/list/_macro.njk" import onsList %} {% set titleSize = params.titleSize | default('2') %} diff --git a/src/components/footer/_macro.njk b/src/components/footer/_macro.njk index 4d7cc9d5be..84564c80ea 100644 --- a/src/components/footer/_macro.njk +++ b/src/components/footer/_macro.njk @@ -1,6 +1,6 @@ {% macro onsFooter(params) %} - {% from "components/lists/_macro.njk" import onsList %} + {% from "components/list/_macro.njk" import onsList %} {% from "components/icons/_macro.njk" import onsIcon %} {% if params.lang %} diff --git a/src/components/lists/_list.scss b/src/components/list/_list.scss similarity index 100% rename from src/components/lists/_list.scss rename to src/components/list/_list.scss diff --git a/src/components/lists/_macro-options.md b/src/components/list/_macro-options.md similarity index 100% rename from src/components/lists/_macro-options.md rename to src/components/list/_macro-options.md diff --git a/src/components/lists/_macro.njk b/src/components/list/_macro.njk similarity index 100% rename from src/components/lists/_macro.njk rename to src/components/list/_macro.njk diff --git a/src/components/lists/_macro.spec.js b/src/components/list/_macro.spec.js similarity index 91% rename from src/components/lists/_macro.spec.js rename to src/components/list/_macro.spec.js index 1989d5b2a3..565c70b621 100644 --- a/src/components/lists/_macro.spec.js +++ b/src/components/list/_macro.spec.js @@ -22,11 +22,11 @@ const EXAMPLE_ITEM_NAVIGATION_TITLE = { navigationTitle: 'Nav friendly title', }; -describe('macro: lists', () => { +describe('macro: list', () => { describe('list element', () => { it('has `id` attribute when provided', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { ...EXAMPLE_LIST_TEXT_ITEMS, id: 'example-id', }), @@ -37,7 +37,7 @@ describe('macro: lists', () => { it('has additionally provided style classes', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { ...EXAMPLE_LIST_TEXT_ITEMS, classes: 'extra-class another-extra-class', }), @@ -49,7 +49,7 @@ describe('macro: lists', () => { it('has provided variant style class when one variant is provided', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { ...EXAMPLE_LIST_TEXT_ITEMS, variants: 'dashed', }), @@ -60,7 +60,7 @@ describe('macro: lists', () => { it('has provided variant style classes when multiple variants are provided', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { ...EXAMPLE_LIST_TEXT_ITEMS, variants: ['dashed', 'inline'], }), @@ -72,7 +72,7 @@ describe('macro: lists', () => { it('assumes the "bare" variant with a prefix modifier class when the first list item has a prefix', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { itemsList: [{ text: 'Item text', prefix: 'Abc' }], }), ); @@ -83,7 +83,7 @@ describe('macro: lists', () => { it('assumes the "bare" variant with a suffix modifier class when the first list item has a suffix', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { itemsList: [{ text: 'Item text', suffix: 'Abc' }], }), ); @@ -94,7 +94,7 @@ describe('macro: lists', () => { it('assumes the "bare" variant with a icons modifier class when the first list item has an icon', () => { const $ = cheerio.load( - renderComponent('lists', { + renderComponent('list', { ...EXAMPLE_LIST_TEXT_ITEMS, iconPosition: 'before', iconType: 'check', @@ -106,14 +106,14 @@ describe('macro: lists', () => { }); it('renders a