Skip to content

Commit

Permalink
Fix failing accessibility test
Browse files Browse the repository at this point in the history
Remove the 'with no options set' example from being tested as part of the standard accessibility tests.

This is because the accessibility test tries to initialise the component's JS, but there is no HTML being rendered to initialise it against, returning an ElementError that Jest considers to be a test failure.
  • Loading branch information
querkmachine committed Apr 26, 2024
1 parent 8262eb0 commit 3089be8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ describe('/components/service-header', () => {
it('passes accessibility tests', async () => {
const examples = await getExamples('service-header')

// Remove the 'with no options set' example from being tested, as the
// component doesn't output anything in that scenario.
delete examples['with no options set']

for (const exampleName in examples) {
await render(page, 'service-header', examples[exampleName])
await expect(axe(page, axeRules)).resolves.toHaveNoViolations()
Expand Down

0 comments on commit 3089be8

Please sign in to comment.