Skip to content

Commit

Permalink
Add template tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto committed Jun 18, 2021
1 parent 90d7f26 commit 1042a8e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/govuk/components/checkboxes/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ describe('Checkboxes', () => {
expect($items.length).toEqual(2)
})

it('render example with a divider and ‘None’ checkbox with exclusive behaviour', () => {
const $ = render('checkboxes', examples['with divider and None'])

const $component = $('.govuk-checkboxes')

const $divider = $component.find('.govuk-checkboxes__divider').first()
expect($divider.text().trim()).toEqual('or')

const $items = $component.find('.govuk-checkboxes__item')
expect($items.length).toEqual(4)

const $orItemInput = $items.last().find('input').first()
expect($orItemInput.attr('data-behaviour')).toEqual('exclusive')
})

it('render additional label classes', () => {
const $ = render('checkboxes', examples['with label classes'])

Expand Down

0 comments on commit 1042a8e

Please sign in to comment.