Skip to content

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

Closed
@drewlee

Description

@drewlee

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

Activity

changed the title [-]a11yAudit Fails to account for include/exclude rules config[/-] [+]a11yAudit fails to account for include/exclude context parameter[/+] on Apr 23, 2019
drewlee

drewlee commented on Apr 23, 2019

@drewlee
ContributorAuthor

Source of the issue:

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

self-assigned this
on Aug 29, 2019
added 2 commits that reference this issue on Sep 4, 2019

Fixes ember-a11y#124. Allows a11yAudit to account for axe inlude/excl…

f84951a
12b777d
drewlee

drewlee commented on Sep 6, 2019

@drewlee
ContributorAuthor

Fix included in PR #132

added a commit that references this issue on Sep 9, 2019

Merge pull request #132 from drewlee/master

7ec9c50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @drewlee

      Issue actions

        a11yAudit fails to account for include/exclude context parameter · Issue #124 · ember-a11y/ember-a11y-testing