Skip to content

Commit

Permalink
Do not disable axe rules for definition lists
Browse files Browse the repository at this point in the history
We wrap each name-value group in the summary list's `<dl>` with a grouping `<div>` element, which is valid according to the current WHATWG HTML spec [1].

At the time we wrote these tests, this was a relatively recent change to the HTML spec, and the axe rules had not been updated to allow it.

Since then, the underlying axe rules have been updated to allow wrapping `<div>` elements [2], so we no longer need to disable the `dlitem` and `definition-list` (released in axe-core 3.2.0 [3])

[1]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-dl-element
[2]: dequelabs/axe-core#1284
[3]: https://github.com/dequelabs/axe-core/blob/develop/CHANGELOG.md#320-2019-03-04
  • Loading branch information
36degrees committed Sep 8, 2021
1 parent 45695f3 commit c9424e5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/govuk/components/summary-list/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ describe('Summary list', () => {
it('passes accessibility tests', async () => {
const $ = render('summary-list', examples.default)

const results = await axe($.html(), {
rules: {
// In newer versions of the HTML specification wrapper
// <div>s are allowed in a definition list
dlitem: { enabled: false },
'definition-list': { enabled: false }
}
})
const results = await axe($.html())
expect(results).toHaveNoViolations()
})
})
Expand Down

0 comments on commit c9424e5

Please sign in to comment.