-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from HTML_CodeSniffer to Axe Puppeteer #435
Conversation
All content should be contained within a landmark Sync with USWDS
throw message; | ||
} | ||
} | ||
const results = await new AxePuppeteer(page).withTags(['wcag2a', 'wcag2aa']).analyze(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is "bare minimum". We could / should choose to omit .withTags(['wcag2a', 'wcag2aa'])
which identifies several more "best practice" failures, but we can improve that iteratively.
const results = await new AxePuppeteer(page).withTags(['wcag2a', 'wcag2aa']).analyze(); | |
const results = await new AxePuppeteer(page).analyze(); |
@@ -0,0 +1,11 @@ | |||
module Kramdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to explicitly load this anywhere so it can take effect? I'd expect a _config.yml
change listing this file. Or does it get magically loaded somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything in _plugins
is magically loaded by Jekyll, and this will override the module method from Kramdown referenced indirectly through Jekyll compilation.
I adapted this approach from similar plugins we use on some other sites like with how we add design system classes to Markdown links in the brochure site.
Some notes for posterity / future self after looking at this a bit: It's complicated by the fact that many code examples assume an isolated environment from sibling code examples so issues like distinct Couple ideas for addressing this:
The "Easier" option might be the best bet for a short-term solution, after timebox exploration. |
🛠 Summary of changes
Updates accessibility tests to use
@axe-core/puppeteer
instead ofHTML_CodeSniffer
, which has a much more thorough accessibility test suite and is more consistent with how we test accessibility in other Login.gov projects.As part of this, updates were made to resolve preexisting accessibility issues:
📜 Testing Plan
make build
node --test test/accessibility.test.js