This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
UI: Fix most a11y violations, modernize a11y testing setup #1499
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were facing a number of accessibility violations with no easy way to triage them. This patch updates us to the latest ember-a11y-testing and adopts the new
setupGlobalA11yHooks
approach wherein the audit is run automatically whenever we callvisit
,click
etc.The new approach also allows us a single point to pass
exclude
options to axe-core, giving us an easy way to mark certain DOM elements as pending (meaning: “we know these have issues, but we can’t fix them right now”). I’ve only added three violations to the exclude list. The rest of the violations were straightforward to fix so I’ve addressed them all directly.The only noticeable changes for users are as follows:
How should I check this?
Check out the branch locally and run the ember test suite. You should see everything is green. The complete steps:
git checkout ui-a11y-updates cd ui yarn ember serve
Then visit http://localhost:4200/tests
Where have the dev-mode stripes gone?
Previously in development mode we’d see prominent diagonal stripes on any elements that violated axe-core’s a11y rules. It looked like this:
ember-a11y-testing dropped this feature in 4.0.0. The rationale can be found in ember-a11y/ember-a11y-testing#205 and the README, but in short the idea is to nudge users towards more-mainstream tools and focus on the ember testing workflow.
I still see violations when I run
ember test
— what gives?There are still a11y failures reported when running the tests headless (
ember test
). These will be addressed in a subsequent PR.