From b20cef1e6c3932f71bf961b9289a26d78b0a209f Mon Sep 17 00:00:00 2001 From: Kimberly Grey Date: Thu, 1 Sep 2022 11:49:02 +0100 Subject: [PATCH] Add data attribute template tests --- src/govuk/components/accordion/template.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/govuk/components/accordion/template.test.js b/src/govuk/components/accordion/template.test.js index ffc1338a4f..48c4033854 100644 --- a/src/govuk/components/accordion/template.test.js +++ b/src/govuk/components/accordion/template.test.js @@ -98,5 +98,15 @@ describe('Accordion', () => { expect($items.length).toEqual(2) }) + + it('renders with localisation data attributes', () => { + const $ = render('accordion', examples['with translations']) + const $component = $('.govuk-accordion') + + expect($component.attr('data-i18n.hide-all-sections')).toEqual('Collapse all sections') + expect($component.attr('data-i18n.show-all-sections')).toEqual('Expand all sections') + expect($component.attr('data-i18n.hide-section')).toEqual('Collapse this section') + expect($component.attr('data-i18n.show-section')).toEqual('Expand this section') + }) }) })