Skip to content

Commit

Permalink
Add data attribute template tests
Browse files Browse the repository at this point in the history
  • Loading branch information
querkmachine committed Sep 1, 2022
1 parent 88ecf1d commit b20cef1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/govuk/components/accordion/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <span class="govuk-visually-hidden">this section</span>')
expect($component.attr('data-i18n.show-section')).toEqual('Expand <span class="govuk-visually-hidden">this section</span>')
})
})
})

0 comments on commit b20cef1

Please sign in to comment.