From b14eb6ff846ed3708e25080d2edbb5862bec0e03 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 9 Nov 2023 09:15:39 +0000 Subject: [PATCH] Fix HTML indentation in YAML files --- .../components/checkboxes/checkboxes.yaml | 2 +- .../cookie-banner/cookie-banner.yaml | 4 ++- .../notification-banner.yaml | 34 +++++++++++-------- .../notification-banner/template.test.js | 10 ++++-- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml index 2a6fda8fa5..c19138e3eb 100644 --- a/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml +++ b/packages/govuk-frontend/src/govuk/components/checkboxes/checkboxes.yaml @@ -150,7 +150,7 @@ examples: - + values: - british diff --git a/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml b/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml index ec1149e612..98d8433749 100644 --- a/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml +++ b/packages/govuk-frontend/src/govuk/components/cookie-banner/cookie-banner.yaml @@ -155,7 +155,9 @@ examples: options: messages: - headingHtml: Cookies on my service - html:

We use cookies in our service.

We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.

+ html: | +

We use cookies in our service.

+

We’d like to use analytics cookies so we can understand how you use the Design System and make improvements.

actions: - text: Accept analytics cookies type: submit diff --git a/packages/govuk-frontend/src/govuk/components/notification-banner/notification-banner.yaml b/packages/govuk-frontend/src/govuk/components/notification-banner/notification-banner.yaml index ef274c7e5e..fe0fd4e489 100644 --- a/packages/govuk-frontend/src/govuk/components/notification-banner/notification-banner.yaml +++ b/packages/govuk-frontend/src/govuk/components/notification-banner/notification-banner.yaml @@ -58,11 +58,15 @@ examples: text: This publication was withdrawn on 7 March 2014. - name: paragraph as html heading options: - html:

You have 9 days to send a response.

+ html: | +

You have 9 days to send a response.

- name: with text as html options: html: | -

This publication was withdrawn on 7 March 2014

Archived and replaced by the new planning guidance launched 6 March 2014 on an external website

+

+ This publication was withdrawn on 7 March 2014 +

+

Archived and replaced by the new planning guidance launched 6 March 2014 on an external website

- name: with type as success options: type: success @@ -71,34 +75,36 @@ examples: options: type: success html: | -

4 files uploaded

+

+ 4 files uploaded +

+ - name: with a list options: html: |

4 files uploaded

- name: with long heading options: text: This publication was withdrawn on 7 March 2014, before being sent in, sent back, queried, lost, found, subjected to public inquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters. - name: with lots of content options: - html: > + html: |

Check if you need to apply the reverse charge to this application

You will have to apply the reverse charge if the applicant supplies any of these services:

- name: auto-focus disabled, with type as success options: diff --git a/packages/govuk-frontend/src/govuk/components/notification-banner/template.test.js b/packages/govuk-frontend/src/govuk/components/notification-banner/template.test.js index f21049cb67..c1cac684af 100644 --- a/packages/govuk-frontend/src/govuk/components/notification-banner/template.test.js +++ b/packages/govuk-frontend/src/govuk/components/notification-banner/template.test.js @@ -1,5 +1,6 @@ const { render } = require('@govuk-frontend/helpers/nunjucks') const { getExamples } = require('@govuk-frontend/lib/components') +const { outdent } = require('outdent') describe('Notification-banner', () => { let examples @@ -198,9 +199,12 @@ describe('Notification-banner', () => { const $ = render('notification-banner', examples['with text as html']) const $contentHtml = $('.govuk-notification-banner__content') - expect($contentHtml.html().trim()).toEqual( - '

This publication was withdrawn on 7 March 2014

Archived and replaced by the new planning guidance launched 6 March 2014 on an external website

' - ) + expect($contentHtml.html().trim()).toEqual(outdent` +

+ This publication was withdrawn on 7 March 2014 +

+

Archived and replaced by the new planning guidance launched 6 March 2014 on an external website

+ `) }) })