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

a11yAudit fails to account for include/exclude context parameter #124

Closed
drewlee opened this issue Apr 23, 2019 · 2 comments
Closed

a11yAudit fails to account for include/exclude context parameter #124

drewlee opened this issue Apr 23, 2019 · 2 comments
Assignees

Comments

@drewlee
Copy link
Contributor

drewlee commented Apr 23, 2019

In addition to a query selector or HTML DOM node, the axe context argument can also include an "include/exclude" pojo. The a11yAudit helper fails to account for this argument format and assumes that the object is the options argument.

For example, the following invocation will execute on the entire document instead of the assigned scope, and will fail to apply the axe configurations set in environment.js:

await a11yAuditIf({
  include: [['.col-thread']],
  exclude: [
    ['[data-control-name="select_gif"]']
  ]
});

The current workaround is to assign null as the second argument to bypass the internal formatting check:

await a11yAuditIf({
  include: [['.col-thread']],
  exclude: [
    ['[data-control-name="select_gif"]']
  ]
}, null);
@drewlee drewlee changed the title a11yAudit Fails to account for include/exclude rules config a11yAudit fails to account for include/exclude context parameter Apr 23, 2019
@drewlee
Copy link
Contributor Author

drewlee commented Apr 23, 2019

Source of the issue:

if (arguments.length === 1 && isPlainObj(contextSelector)) {
Needs a bit more thorough checking in addition to the pojo check.

@drewlee drewlee self-assigned this Aug 29, 2019
drewlee pushed a commit to drewlee/ember-a11y-testing that referenced this issue Sep 4, 2019
@drewlee
Copy link
Contributor Author

drewlee commented Sep 6, 2019

Fix included in PR #132

@drewlee drewlee closed this as completed in f84951a Sep 9, 2019
drewlee pushed a commit that referenced this issue Sep 9, 2019
Fixes #124. Allows a11yAudit to account for axe include/exclude context param.
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

No branches or pull requests

1 participant