Skip to content

Commit 7839346

Browse files
frankierobertoowenatgov
authored andcommitted
Ignore AAA contrast warning on panel
In common with other components, the panel doesn't meet the AAA contrast ratio of 7:1 for small text (under 24px) The contrast ratio for white text on blue panels is 5.16:1 The contrast ratio for white text on green panels is 4.52:1 (however by default these use large text)
1 parent 02f021a commit 7839346

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/govuk-frontend/src/govuk/components/panel/accessibility.puppeteer.test.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@ import { axe, render } from '@govuk-frontend/helpers/puppeteer'
22
import { getExamples } from '@govuk-frontend/lib/components'
33

44
describe('/components/panel', () => {
5+
let axeRules
6+
7+
beforeAll(() => {
8+
axeRules = {
9+
/**
10+
* Ignore 'Element has insufficient color contrast' for WCAG Level AAA
11+
*
12+
* Affects regular size text on the green and blue panels
13+
*/
14+
'color-contrast-enhanced': { enabled: false }
15+
}
16+
})
517
describe('component examples', () => {
618
it('passes accessibility tests', async () => {
719
const examples = await getExamples('panel')
820

921
for (const exampleName in examples) {
1022
await render(page, 'panel', examples[exampleName])
11-
await expect(axe(page)).resolves.toHaveNoViolations()
23+
await expect(axe(page, axeRules)).resolves.toHaveNoViolations()
1224
}
1325
}, 120000)
1426
})

0 commit comments

Comments
 (0)