-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core: page function updates relating to upcoming tap targets audit #6702
core: page function updates relating to upcoming tap targets audit #6702
Conversation
030fb89
to
ebeee1b
Compare
ebeee1b
to
d63af0c
Compare
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.
LGTM % test!
@@ -44,5 +44,10 @@ describe('DetailsRenderer', () => { | |||
['style-missing', 'aria-label-missing'] | |||
), '<div id="1" style="style" aria-label="label">'); | |||
}); | |||
|
|||
it('works if attribute values contain line breaks', () => { |
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.
❤️
* @returns {string} | ||
*/ | ||
/* istanbul ignore next */ | ||
function getNodeSelector(node) { |
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.
think we could get a quick test for this function? don't need crazy coverage just something to make sure we don't break it
@@ -45,6 +45,7 @@ function runA11yChecks() { | |||
// Augment the node objects with outerHTML snippet & custom path string | |||
// @ts-ignore | |||
axeResult.violations.forEach(v => v.nodes.forEach(node => { | |||
// @ts-ignore - getNodePath put into scope via stringification | |||
node.path = getNodePath(node.element); |
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.
you could keep this the same, if you also export getNodePath
in page-functions.js
.
Will need that module to export getNodePath
for linking nodes in the report for the font-size audit (#6436) (and for other non-accessibility audits).
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.
I'm not sure what you mean @hoten, it's run in the context of the page and he's exported the stringified version which is what he'll need, no?
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.
Didn't realize all of that was running in context of the page. Nevermind!
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.
LGTM!
Summary
Splitting up this PR into more digestible bits.
This PR just contains some page function tweaks, and a new function to get an element selector that we can show to the user.
Related Issues/PRs
Tap targets ticket: #4358