a11yAudit fails to account for include/exclude context parameter
drewlee opened this issue · 2 comments
drewlee commented
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 commented
Source of the issue:
Needs a bit more thorough checking in addition to the pojo check.