Skip to content

Commit

Permalink
fix(metadata): Map aria-required-children to ACT rule bc4a75 (#3790)
Browse files Browse the repository at this point in the history
* fix(metadata): Map aria-required-children to ACT rule bc4a75

* Update rule-desc
  • Loading branch information
WilcoFiers committed Nov 21, 2022
1 parent d5c3b91 commit a33a523
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/rule-descriptions.md
Expand Up @@ -23,7 +23,7 @@
| [aria-meter-name](https://dequeuniversity.com/rules/axe/4.5/aria-meter-name?application=RuleDescription) | Ensures every ARIA meter node has an accessible name | Serious | cat.aria, wcag2a, wcag111 | failure, needs review | |
| [aria-progressbar-name](https://dequeuniversity.com/rules/axe/4.5/aria-progressbar-name?application=RuleDescription) | Ensures every ARIA progressbar node has an accessible name | Serious | cat.aria, wcag2a, wcag111 | failure, needs review | |
| [aria-required-attr](https://dequeuniversity.com/rules/axe/4.5/aria-required-attr?application=RuleDescription) | Ensures elements with ARIA roles have all required ARIA attributes | Critical | cat.aria, wcag2a, wcag412 | failure | [4e8ab6](https://act-rules.github.io/rules/4e8ab6) |
| [aria-required-children](https://dequeuniversity.com/rules/axe/4.5/aria-required-children?application=RuleDescription) | Ensures elements with an ARIA role that require child roles contain them | Critical | cat.aria, wcag2a, wcag131 | failure, needs review | [bc4a75](https://act-rules.github.io/rules/bc4a75) |
| [aria-required-children](https://dequeuniversity.com/rules/axe/4.5/aria-required-children?application=RuleDescription) | Ensures elements with an ARIA role that require child roles contain them | Critical | cat.aria, wcag2a, wcag131 | failure, needs review | [bc4a75](https://act-rules.github.io/rules/bc4a75), [ff89c9](https://act-rules.github.io/rules/ff89c9) |
| [aria-required-parent](https://dequeuniversity.com/rules/axe/4.5/aria-required-parent?application=RuleDescription) | Ensures elements with an ARIA role that require parent roles are contained by them | Critical | cat.aria, wcag2a, wcag131 | failure | [ff89c9](https://act-rules.github.io/rules/ff89c9) |
| [aria-roledescription](https://dequeuniversity.com/rules/axe/4.5/aria-roledescription?application=RuleDescription) | Ensure aria-roledescription is only used on elements with an implicit or explicit role | Serious | cat.aria, wcag2a, wcag412 | failure, needs review | |
| [aria-roles](https://dequeuniversity.com/rules/axe/4.5/aria-roles?application=RuleDescription) | Ensures all elements with a role attribute use a valid value | Minor, Serious, Critical | cat.aria, wcag2a, wcag412 | failure | [674b10](https://act-rules.github.io/rules/674b10) |
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/aria-required-children.json
Expand Up @@ -3,7 +3,7 @@
"selector": "[role]",
"matches": "aria-required-children-matches",
"tags": ["cat.aria", "wcag2a", "wcag131"],
"actIds": ["bc4a75"],
"actIds": ["bc4a75", "ff89c9"],
"metadata": {
"description": "Ensures elements with an ARIA role that require child roles contain them",
"help": "Certain ARIA roles must contain particular children"
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -174,7 +174,7 @@
"typedarray": "^0.0.6",
"typescript": "^4.7.4",
"uglify-js": "^3.16.2",
"wcag-act-rules": "github:w3c/wcag-act-rules#a60a4e62f2",
"wcag-act-rules": "github:w3c/wcag-act-rules#9416ea6",
"weakmap-polyfill": "^2.0.4"
},
"lint-staged": {
Expand Down
11 changes: 9 additions & 2 deletions test/act-rules/act-runner.js
Expand Up @@ -76,10 +76,17 @@ module.exports = ({ id, title, axeRules, skipTests = [] }) => {
const results = await builder.analyze();

if (testcase.expected !== 'failed') {
assert.lengthOf(results.violations, 0, 'Expected 0 violations');
assert.lengthOf(
results.violations,
0,
`Expected 0 violations for testcase ${testcase.testcaseId}`
);
} else {
var issues = results.violations[0] || results.incomplete[0];
assert.isDefined(issues, 'Expected violations or incomplete');
assert.isDefined(
issues,
`Expected violations or incomplete for testcase ${testcase.testcaseId}`
);
assert.isAtLeast(issues.nodes.length, 1);
}
});
Expand Down
7 changes: 7 additions & 0 deletions test/act-rules/aria-required-context-ff89c9.spec.js
@@ -0,0 +1,7 @@
require('./act-runner.js')({
id: 'ff89c9',
title: 'ARIA required context role',
axeRules: ['aria-required-parent', 'aria-required-children'],
// See https://github.com/act-rules/act-rules.github.io/pull/1973
skipTests: ['c18579dc18aaebf7eeaa4e24e4bc199d77c432bc']
});
3 changes: 1 addition & 2 deletions test/act-rules/aria-required-owned-element-bc4a75.spec.js
@@ -1,6 +1,5 @@
require('./act-runner.js')({
id: 'bc4a75',
title: 'ARIA required owned elements',
axeRules: ['aria-required-children'],
skipTests: ['52c725e462af074a3559cf4bf4d4dd2386168938']
axeRules: ['aria-required-children']
});
Expand Up @@ -6,5 +6,7 @@ require('./act-runner.js')({
'select-name',
'aria-input-field-name',
'aria-toggle-field-name'
]
],
// See: https://github.com/act-rules/act-rules.github.io/pull/1974
skipTests: ['b8e68dccf37727dd39af9fca76a8371a8ec5a81f']
});

0 comments on commit a33a523

Please sign in to comment.