Skip to content
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

Merged

Conversation

mattzeunert
Copy link
Contributor

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

Copy link
Collaborator

@patrickhulce patrickhulce left a 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', () => {
Copy link
Collaborator

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) {
Copy link
Collaborator

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);
Copy link
Collaborator

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).

Copy link
Collaborator

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?

Copy link
Collaborator

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!

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants