From 405253b3cb59b5505b811a7045ab7fe96befc9c3 Mon Sep 17 00:00:00 2001 From: SriHV Date: Wed, 21 Aug 2024 15:38:22 +0100 Subject: [PATCH 01/27] modified test cases as per the ticket --- src/components/address-output/_macro.spec.js | 147 +++++++++++------- .../address-output/_test_examples.js | 12 ++ 2 files changed, 99 insertions(+), 60 deletions(-) create mode 100644 src/components/address-output/_test_examples.js diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index d94484c316..34bdb4bcf7 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -5,94 +5,121 @@ import * as cheerio from 'cheerio'; import axe from '../../tests/helpers/axe'; import { renderComponent } from '../../tests/helpers/rendering'; -const EXAMPLE_ADDRESS_OUTPUT_FULL = { - unit: 'Unit 5', - organisation: 'Trescos', - line1: 'Abingdon Road', - line2: 'Goathill', - town: 'Barry', - postcode: 'AB12 6UH', -}; - -const EXAMPLE_ADDRESS_OUTPUT_NONE = {}; - -describe('macro: address-output', () => { - it('passes jest-axe checks', async () => { - const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); - - const results = await axe($.html()); - expect(results).toHaveNoViolations(); +import { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE } from './_test_examples'; + +describe('FOR: address-output', () => { + describe('GIVEN: Params: none', () => { + describe('WHEN: All params are at default state', () => { + const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); + + test('THEN: jest-axe tests pass', async () => { + const results = await axe($.html()); + expect(results).toHaveNoViolations(); + }); + }); }); - it('has additionally provided container style classes', () => { - const $ = cheerio.load( - renderComponent('address-output', { - ...EXAMPLE_ADDRESS_OUTPUT_FULL, - classes: 'extra-class another-extra-class', - }), - ); - - expect($('.ons-address-output').hasClass('extra-class')).toBe(true); - expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); + describe('GIVEN: Params: classes', () => { + describe('WHEN: classes are provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + ...EXAMPLE_ADDRESS_OUTPUT_FULL, + classes: 'extra-class another-extra-class', + }), + ); + + test('THEN: additionally provided classes are rendered', async () => { + expect($('.ons-address-output').hasClass('extra-class')).toBe(true); + expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); + }); + }); }); - it('renders no lines when no parameters are provided', () => { - const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); + describe('GIVEN: Params: none', () => { + describe('WHEN: no address lines are provided in the parameters', () => { + const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); - expect($('.ons-address-output__lines *').length).toBe(0); + test('THEN: no lines are rendered', () => { + expect($('.ons-address-output__lines *').length).toBe(0); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { unit: 'Unit 5' }], - ])('renders `unit` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `unit` is rendered correctly', () => { + expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { organisation: 'Trescos' }], - ])('renders `organisation` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `organisation` is rendered correctly', () => { + expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { line1: 'Abingdon Road' }], - ])('renders `line1` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `line1` is rendered correctly', () => { + expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { line2: 'Goathill' }], - ])('renders `line2` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `line2` is rendered correctly', () => { + expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { town: 'Barry' }], - ])('renders `town` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__town').text().trim()).toBe('Barry'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `town` is rendered correctly', () => { + expect($('.ons-address-output__town').text().trim()).toBe('Barry'); + }); + }); }); - it.each([ + describe.each([ ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { postcode: 'AB12 6UH' }], - ])('renders `postcode` with %s', (_, params) => { - const $ = cheerio.load(renderComponent('address-output', params)); - - expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); + ])('GIVEN: %s', (scenario, params) => { + describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + const $ = cheerio.load(renderComponent('address-output', params)); + + test('THEN: the `postcode` is rendered correctly', () => { + expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); + }); + }); }); }); diff --git a/src/components/address-output/_test_examples.js b/src/components/address-output/_test_examples.js new file mode 100644 index 0000000000..5e2c316241 --- /dev/null +++ b/src/components/address-output/_test_examples.js @@ -0,0 +1,12 @@ +export { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE }; + +const EXAMPLE_ADDRESS_OUTPUT_FULL = { + unit: 'Unit 5', + organisation: 'Trescos', + line1: 'Abingdon Road', + line2: 'Goathill', + town: 'Barry', + postcode: 'AB12 6UH', +}; + +const EXAMPLE_ADDRESS_OUTPUT_NONE = {}; From c5b55b435c5e7bd062812b5916378899fe63e2a7 Mon Sep 17 00:00:00 2001 From: SriHV Date: Wed, 21 Aug 2024 16:04:44 +0100 Subject: [PATCH 02/27] changes in the given statements --- src/components/address-output/_macro.spec.js | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 34bdb4bcf7..312519744e 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -28,7 +28,7 @@ describe('FOR: address-output', () => { }), ); - test('THEN: additionally provided classes are rendered', async () => { + test('THEN: renders additionally provided classes', async () => { expect($('.ons-address-output').hasClass('extra-class')).toBe(true); expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); }); @@ -39,7 +39,7 @@ describe('FOR: address-output', () => { describe('WHEN: no address lines are provided in the parameters', () => { const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); - test('THEN: no lines are rendered', () => { + test('THEN: renders no lines', () => { expect($('.ons-address-output__lines *').length).toBe(0); }); }); @@ -49,10 +49,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { unit: 'Unit 5' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `unit` is rendered correctly', () => { + test('THEN: renders `unit` correctly', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); }); @@ -62,10 +62,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { organisation: 'Trescos' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `organisation` is rendered correctly', () => { + test('THEN: renders `organisation` correctly', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); }); @@ -75,10 +75,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { line1: 'Abingdon Road' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `line1` is rendered correctly', () => { + test('THEN: renders `line1` correctly', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); }); @@ -88,10 +88,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { line2: 'Goathill' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `line2` is rendered correctly', () => { + test('THEN: renders `line2` correctly', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); }); @@ -101,10 +101,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { town: 'Barry' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `town` is rendered correctly', () => { + test('THEN: renders the `town` correctly', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); }); @@ -114,10 +114,10 @@ describe('FOR: address-output', () => { ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], ['single line', { postcode: 'AB12 6UH' }], ])('GIVEN: %s', (scenario, params) => { - describe(`WHEN: the address-output is rendered with ${scenario}`, () => { + describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: the `postcode` is rendered correctly', () => { + test('THEN: renders the `postcode` correctly', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); From 0c9d6bac4d4f6292413dee2985c4b471a2f93997 Mon Sep 17 00:00:00 2001 From: SriHV Date: Thu, 22 Aug 2024 16:03:29 +0100 Subject: [PATCH 03/27] changes as per comments --- src/components/address-output/_macro.spec.js | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 312519744e..0bf1162d78 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -8,7 +8,7 @@ import { renderComponent } from '../../tests/helpers/rendering'; import { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE } from './_test_examples'; describe('FOR: address-output', () => { - describe('GIVEN: Params: none', () => { + describe('GIVEN: Params: default', () => { describe('WHEN: All params are at default state', () => { const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); @@ -28,7 +28,7 @@ describe('FOR: address-output', () => { }), ); - test('THEN: renders additionally provided classes', async () => { + test('THEN: renders with additional classes provided', async () => { expect($('.ons-address-output').hasClass('extra-class')).toBe(true); expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); }); @@ -36,7 +36,7 @@ describe('FOR: address-output', () => { }); describe('GIVEN: Params: none', () => { - describe('WHEN: no address lines are provided in the parameters', () => { + describe('WHEN: no parameters are provided', () => { const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); test('THEN: renders no lines', () => { @@ -46,78 +46,78 @@ describe('FOR: address-output', () => { }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { unit: 'Unit 5' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter unit provided', { unit: 'Unit 5' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders `unit` correctly', () => { + test('THEN: renders `unit` line correctly', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); }); }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { organisation: 'Trescos' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter organisation provided', { organisation: 'Trescos' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders `organisation` correctly', () => { + test('THEN: renders `organisation` line correctly', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); }); }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { line1: 'Abingdon Road' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter line1 provided', { line1: 'Abingdon Road' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders `line1` correctly', () => { + test('THEN: renders `line1` line correctly', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); }); }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { line2: 'Goathill' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter line2 provided', { line2: 'Goathill' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders `line2` correctly', () => { + test('THEN: renders `line2` line correctly', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); }); }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { town: 'Barry' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter town provided', { town: 'Barry' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders the `town` correctly', () => { + test('THEN: renders the `town` line correctly', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); }); }); describe.each([ - ['all address lines', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single line', { postcode: 'AB12 6UH' }], - ])('GIVEN: %s', (scenario, params) => { + ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], + ['single parameter postcode provided', { postcode: 'AB12 6UH' }], + ])('GIVEN: Params: %s', (scenario, params) => { describe(`WHEN: the address-output with ${scenario}`, () => { const $ = cheerio.load(renderComponent('address-output', params)); - test('THEN: renders the `postcode` correctly', () => { + test('THEN: renders the `postcode` line correctly', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); From 4284cfec9091fdc4d2a1189ddd49660b78986aad Mon Sep 17 00:00:00 2001 From: SriHV Date: Tue, 3 Sep 2024 15:36:20 +0100 Subject: [PATCH 04/27] commiting latest changes --- src/components/address-output/_macro.spec.js | 61 ++++++++++++++++---- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 0bf1162d78..bcb73e78e3 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -8,13 +8,12 @@ import { renderComponent } from '../../tests/helpers/rendering'; import { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE } from './_test_examples'; describe('FOR: address-output', () => { - describe('GIVEN: Params: default', () => { - describe('WHEN: All params are at default state', () => { - const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); + describe('GIVEN: Params: none', () => { + describe('WHEN: no parameters are provided', () => { + const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); - test('THEN: jest-axe tests pass', async () => { - const results = await axe($.html()); - expect(results).toHaveNoViolations(); + test('THEN: renders no lines', () => { + expect($('.ons-address-output__lines *').length).toBe(0); }); }); }); @@ -35,12 +34,52 @@ describe('FOR: address-output', () => { }); }); - describe('GIVEN: Params: none', () => { - describe('WHEN: no parameters are provided', () => { - const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); + describe('GIVEN: Params: All params', () => { + describe('WHEN: All address line params are provided', () => { + const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); - test('THEN: renders no lines', () => { - expect($('.ons-address-output__lines *').length).toBe(0); + test('THEN: jest-axe tests pass', async () => { + const results = await axe($.html()); + expect(results).toHaveNoViolations(); + }); + + test('THEN: renders `unit` line correctly', () => { + expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); + }); + + test('THEN: renders `organisation` line correctly', () => { + expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); + }); + + test('THEN: renders `line1` line correctly', () => { + expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); + }); + + test('THEN: renders `line2` line correctly', () => { + expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); + }); + + test('THEN: renders the `town` line correctly', () => { + expect($('.ons-address-output__town').text().trim()).toBe('Barry'); + }); + + test('THEN: renders the `postcode` line correctly', () => { + expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); + }); + }); + }); + + describe('GIVEN: Params: single param', () => { + describe('WHEN: classes are provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + unit: 'Unit 5', + }), + ); + + test('THEN: renders with additional classes provided', async () => { + expect($('.ons-address-output').hasClass('extra-class')).toBe(true); + expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); }); }); }); From 3ecbead2a2c9cafb65278d86ac098bb1bef474f2 Mon Sep 17 00:00:00 2001 From: SriHV Date: Tue, 3 Sep 2024 16:03:19 +0100 Subject: [PATCH 05/27] Changes as per comments --- src/components/address-output/_macro.spec.js | 105 ++++++++----------- 1 file changed, 43 insertions(+), 62 deletions(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index bcb73e78e3..07714c3f65 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -43,120 +43,101 @@ describe('FOR: address-output', () => { expect(results).toHaveNoViolations(); }); - test('THEN: renders `unit` line correctly', () => { + test('THEN: renders `unit` line with correct text', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); - test('THEN: renders `organisation` line correctly', () => { + test('THEN: renders `organisation` line with correct text', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); - test('THEN: renders `line1` line correctly', () => { + test('THEN: renders `line1` line with correct text', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); - test('THEN: renders `line2` line correctly', () => { + test('THEN: renders `line2` line with correct text', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); - test('THEN: renders the `town` line correctly', () => { + test('THEN: renders the `town` line with correct text', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); - test('THEN: renders the `postcode` line correctly', () => { + test('THEN: renders the `postcode` line with correct text', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); }); describe('GIVEN: Params: single param', () => { - describe('WHEN: classes are provided', () => { + describe('WHEN: the `unit` address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { unit: 'Unit 5', }), ); - test('THEN: renders with additional classes provided', async () => { - expect($('.ons-address-output').hasClass('extra-class')).toBe(true); - expect($('.ons-address-output').hasClass('another-extra-class')).toBe(true); - }); - }); - }); - - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter unit provided', { unit: 'Unit 5' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); - - test('THEN: renders `unit` line correctly', () => { + test('THEN: renders `unit` line with correct text', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); }); - }); - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter organisation provided', { organisation: 'Trescos' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); + describe('WHEN: the `organisation` address line is the only parameter provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + organisation: 'Trescos', + }), + ); - test('THEN: renders `organisation` line correctly', () => { + test('THEN: renders `organisation` line with correct text', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); }); - }); - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter line1 provided', { line1: 'Abingdon Road' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); + describe('WHEN: the `line1` address line is the only parameter provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + line1: 'Abingdon Road', + }), + ); - test('THEN: renders `line1` line correctly', () => { + test('THEN: renders `line1` line with correct text', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); }); - }); - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter line2 provided', { line2: 'Goathill' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); + describe('WHEN: the `line2` address line is the only parameter provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + line2: 'Goathill', + }), + ); - test('THEN: renders `line2` line correctly', () => { + test('THEN: renders `line2` line with correct text', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); }); - }); - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter town provided', { town: 'Barry' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); + describe('WHEN: the `town` address line is the only parameter provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + town: 'Barry', + }), + ); - test('THEN: renders the `town` line correctly', () => { + test('THEN: renders `town` line with correct text', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); }); - }); - describe.each([ - ['all parameters provided', EXAMPLE_ADDRESS_OUTPUT_FULL], - ['single parameter postcode provided', { postcode: 'AB12 6UH' }], - ])('GIVEN: Params: %s', (scenario, params) => { - describe(`WHEN: the address-output with ${scenario}`, () => { - const $ = cheerio.load(renderComponent('address-output', params)); + describe('WHEN: the `postcode` address line is the only parameter provided', () => { + const $ = cheerio.load( + renderComponent('address-output', { + postcode: 'AB12 6UH', + }), + ); - test('THEN: renders the `postcode` line correctly', () => { + test('THEN: renders `postcode` line with correct text', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); From 0f064203540b1bc1e525b9225c988f0f6f0549ac Mon Sep 17 00:00:00 2001 From: SriHV Date: Thu, 5 Sep 2024 12:38:02 +0100 Subject: [PATCH 06/27] removing no params example --- src/components/address-output/_macro.spec.js | 4 ++-- src/components/address-output/_test_examples.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 07714c3f65..82918b7e39 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -5,12 +5,12 @@ import * as cheerio from 'cheerio'; import axe from '../../tests/helpers/axe'; import { renderComponent } from '../../tests/helpers/rendering'; -import { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE } from './_test_examples'; +import { EXAMPLE_ADDRESS_OUTPUT_FULL } from './_test_examples'; describe('FOR: address-output', () => { describe('GIVEN: Params: none', () => { describe('WHEN: no parameters are provided', () => { - const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_NONE)); + const $ = cheerio.load(renderComponent('address-output', {})); test('THEN: renders no lines', () => { expect($('.ons-address-output__lines *').length).toBe(0); diff --git a/src/components/address-output/_test_examples.js b/src/components/address-output/_test_examples.js index 5e2c316241..ee145d265d 100644 --- a/src/components/address-output/_test_examples.js +++ b/src/components/address-output/_test_examples.js @@ -1,4 +1,4 @@ -export { EXAMPLE_ADDRESS_OUTPUT_FULL, EXAMPLE_ADDRESS_OUTPUT_NONE }; +export { EXAMPLE_ADDRESS_OUTPUT_FULL }; const EXAMPLE_ADDRESS_OUTPUT_FULL = { unit: 'Unit 5', @@ -8,5 +8,3 @@ const EXAMPLE_ADDRESS_OUTPUT_FULL = { town: 'Barry', postcode: 'AB12 6UH', }; - -const EXAMPLE_ADDRESS_OUTPUT_NONE = {}; From 45e365d0b062080709efa02f4c6c13502047f603 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:05:55 +0100 Subject: [PATCH 07/27] Update src/components/address-output/_test_examples.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_test_examples.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/address-output/_test_examples.js b/src/components/address-output/_test_examples.js index ee145d265d..08bb96889f 100644 --- a/src/components/address-output/_test_examples.js +++ b/src/components/address-output/_test_examples.js @@ -1,6 +1,4 @@ -export { EXAMPLE_ADDRESS_OUTPUT_FULL }; - -const EXAMPLE_ADDRESS_OUTPUT_FULL = { +export const EXAMPLE_ADDRESS_OUTPUT_FULL = { unit: 'Unit 5', organisation: 'Trescos', line1: 'Abingdon Road', From b5299aba1249fb30359f0a57e15b743842eba10e Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:06:03 +0100 Subject: [PATCH 08/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 82918b7e39..a4a52c2f48 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -43,7 +43,7 @@ describe('FOR: address-output', () => { expect(results).toHaveNoViolations(); }); - test('THEN: renders `unit` line with correct text', () => { + test('THEN: renders unit with provided text', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); From 999c4f7ee35d52be07838307cde7a5c8133fe01f Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:24:44 +0100 Subject: [PATCH 09/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index a4a52c2f48..c9f44c3108 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -7,7 +7,7 @@ import { renderComponent } from '../../tests/helpers/rendering'; import { EXAMPLE_ADDRESS_OUTPUT_FULL } from './_test_examples'; -describe('FOR: address-output', () => { +describe('FOR: Macro: Address-output', () => { describe('GIVEN: Params: none', () => { describe('WHEN: no parameters are provided', () => { const $ = cheerio.load(renderComponent('address-output', {})); From ea2c0e5a4483ab1ab12b708f62d1b2fb3774a869 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:03 +0100 Subject: [PATCH 10/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index c9f44c3108..ee5bc2240d 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -35,7 +35,7 @@ describe('FOR: Macro: Address-output', () => { }); describe('GIVEN: Params: All params', () => { - describe('WHEN: All address line params are provided', () => { + describe('WHEN: all address line params are provided', () => { const $ = cheerio.load(renderComponent('address-output', EXAMPLE_ADDRESS_OUTPUT_FULL)); test('THEN: jest-axe tests pass', async () => { From fe023bb795bb643e6225a761ed03c2b3631c12d2 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:15 +0100 Subject: [PATCH 11/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index ee5bc2240d..eeeaa1fdf4 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -47,7 +47,7 @@ describe('FOR: Macro: Address-output', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); - test('THEN: renders `organisation` line with correct text', () => { + test('THEN: renders organisation line with correct text', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); From 317bffa1ebba0545fe4c47967520e9715a3664b4 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:27 +0100 Subject: [PATCH 12/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index eeeaa1fdf4..60a26fda1d 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -51,7 +51,7 @@ describe('FOR: Macro: Address-output', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); - test('THEN: renders `line1` line with correct text', () => { + test('THEN: renders line1 line with correct text', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); From 20cec66d6e7b5cf593554c8dc320ddfad39c7007 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:34 +0100 Subject: [PATCH 13/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 60a26fda1d..e3da0c72bb 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -55,7 +55,7 @@ describe('FOR: Macro: Address-output', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); - test('THEN: renders `line2` line with correct text', () => { + test('THEN: renders line2 line with correct text', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); From 46971276146757005c8921281b3afa2555f0570a Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:48 +0100 Subject: [PATCH 14/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index e3da0c72bb..cb83d4eaa0 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -59,7 +59,7 @@ describe('FOR: Macro: Address-output', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); - test('THEN: renders the `town` line with correct text', () => { + test('THEN: renders the town line with correct text', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); From 12d8e0cd915f61e76e92a54221e9e5ca9f1e8866 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:25:54 +0100 Subject: [PATCH 15/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index cb83d4eaa0..b34b8e225c 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -63,7 +63,7 @@ describe('FOR: Macro: Address-output', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); - test('THEN: renders the `postcode` line with correct text', () => { + test('THEN: renders the postcode line with correct text', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); From 7aff671234ef2b42393b495ddd06b97523cd8fa1 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:02 +0100 Subject: [PATCH 16/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index b34b8e225c..d8656709b4 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -70,7 +70,7 @@ describe('FOR: Macro: Address-output', () => { }); describe('GIVEN: Params: single param', () => { - describe('WHEN: the `unit` address line is the only parameter provided', () => { + describe('WHEN: the unit address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { unit: 'Unit 5', From 894d32d9661efb0755d76c82d375ce7884081599 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:18 +0100 Subject: [PATCH 17/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index d8656709b4..683904da6e 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -77,7 +77,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `unit` line with correct text', () => { + test('THEN: renders unit line with correct text', () => { expect($('.ons-address-output__unit').text().trim()).toBe('Unit 5'); }); }); From 3b4d693af8ee9f0527254faf5e4a2c1fd3764365 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:26 +0100 Subject: [PATCH 18/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 683904da6e..aa803673d7 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -113,7 +113,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `line2` line with correct text', () => { + test('THEN: renders line2 line with correct text', () => { expect($('.ons-address-output__line2').text().trim()).toBe('Goathill'); }); }); From a7f4253600cc9ed9f3b8a26b981d43f90d100270 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:38 +0100 Subject: [PATCH 19/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index aa803673d7..d100b5d892 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -82,7 +82,7 @@ describe('FOR: Macro: Address-output', () => { }); }); - describe('WHEN: the `organisation` address line is the only parameter provided', () => { + describe('WHEN: the organisation address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { organisation: 'Trescos', From 2fb31fd5ded1489c089509018e7803497cbd2d38 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:47 +0100 Subject: [PATCH 20/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index d100b5d892..f245c6d999 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -106,7 +106,7 @@ describe('FOR: Macro: Address-output', () => { }); }); - describe('WHEN: the `line2` address line is the only parameter provided', () => { + describe('WHEN: the line2 address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { line2: 'Goathill', From 6e69fc870ecf0b4a5493bf848a66564664c1971a Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:26:55 +0100 Subject: [PATCH 21/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index f245c6d999..dbdc514738 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -101,7 +101,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `line1` line with correct text', () => { + test('THEN: renders line1 line with correct text', () => { expect($('.ons-address-output__line1').text().trim()).toBe('Abingdon Road'); }); }); From 389c41ee0f5a57bfcce4da26821c6e410e9686cb Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:27:02 +0100 Subject: [PATCH 22/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index dbdc514738..70588bdf6f 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -94,7 +94,7 @@ describe('FOR: Macro: Address-output', () => { }); }); - describe('WHEN: the `line1` address line is the only parameter provided', () => { + describe('WHEN: the line1 address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { line1: 'Abingdon Road', From c81062227e16e3e57631d8c85a79266a0f00d0d3 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:27:10 +0100 Subject: [PATCH 23/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 70588bdf6f..16ae34e063 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -89,7 +89,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `organisation` line with correct text', () => { + test('THEN: renders organisation line with correct text', () => { expect($('.ons-address-output__organisation').text().trim()).toBe('Trescos'); }); }); From f0a1ca6c1c57ab9921497a4e9cbdf8e5c6606581 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:27:27 +0100 Subject: [PATCH 24/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 16ae34e063..52db0e280b 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -137,7 +137,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `postcode` line with correct text', () => { + test('THEN: renders postcode line with correct text', () => { expect($('.ons-address-output__postcode').text().trim()).toBe('AB12 6UH'); }); }); From d50ec2b40fe36ac592f5c98f3317b072a3974b1e Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:27:38 +0100 Subject: [PATCH 25/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 52db0e280b..60af6ccc05 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -130,7 +130,7 @@ describe('FOR: Macro: Address-output', () => { }); }); - describe('WHEN: the `postcode` address line is the only parameter provided', () => { + describe('WHEN: the postcode address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { postcode: 'AB12 6UH', From d206b269f7ab99431a23f75e94eeaf16f2efe391 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:27:51 +0100 Subject: [PATCH 26/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index 60af6ccc05..cdb865f670 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -125,7 +125,7 @@ describe('FOR: Macro: Address-output', () => { }), ); - test('THEN: renders `town` line with correct text', () => { + test('THEN: renders town line with correct text', () => { expect($('.ons-address-output__town').text().trim()).toBe('Barry'); }); }); From 5c5b3bfa21486045090544a6648b5674e113fc16 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:28:04 +0100 Subject: [PATCH 27/27] Update src/components/address-output/_macro.spec.js Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/address-output/_macro.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/address-output/_macro.spec.js b/src/components/address-output/_macro.spec.js index cdb865f670..692cf12432 100644 --- a/src/components/address-output/_macro.spec.js +++ b/src/components/address-output/_macro.spec.js @@ -118,7 +118,7 @@ describe('FOR: Macro: Address-output', () => { }); }); - describe('WHEN: the `town` address line is the only parameter provided', () => { + describe('WHEN: the town address line is the only parameter provided', () => { const $ = cheerio.load( renderComponent('address-output', { town: 'Barry',