From a33a523eb4dfdc62743d78aab124e74afc98a59e Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Mon, 21 Nov 2022 22:55:25 +0100 Subject: [PATCH] fix(metadata): Map aria-required-children to ACT rule bc4a75 (#3790) * fix(metadata): Map aria-required-children to ACT rule bc4a75 * Update rule-desc --- doc/rule-descriptions.md | 2 +- lib/rules/aria-required-children.json | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- test/act-rules/act-runner.js | 11 +++++++++-- test/act-rules/aria-required-context-ff89c9.spec.js | 7 +++++++ .../aria-required-owned-element-bc4a75.spec.js | 3 +-- ...orm-field-non-empty-accessible-name-e086e5.spec.js | 4 +++- 8 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 test/act-rules/aria-required-context-ff89c9.spec.js diff --git a/doc/rule-descriptions.md b/doc/rule-descriptions.md index 8963517437..0774da3a8c 100644 --- a/doc/rule-descriptions.md +++ b/doc/rule-descriptions.md @@ -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) | diff --git a/lib/rules/aria-required-children.json b/lib/rules/aria-required-children.json index d7a315e174..d29c911d8e 100644 --- a/lib/rules/aria-required-children.json +++ b/lib/rules/aria-required-children.json @@ -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" diff --git a/package-lock.json b/package-lock.json index 6c6c638ab2..ea7a988fd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,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" }, "engines": { @@ -11572,7 +11572,7 @@ } }, "node_modules/wcag-act-rules": { - "resolved": "git+ssh://git@github.com/w3c/wcag-act-rules.git#a60a4e62f2eea5021cf20470fb908ae812aa7fb5", + "resolved": "git+ssh://git@github.com/w3c/wcag-act-rules.git#9416ea60714ed6c916435c7b38db76062f3ef004", "dev": true }, "node_modules/weakmap-polyfill": { @@ -20693,9 +20693,9 @@ } }, "wcag-act-rules": { - "version": "git+ssh://git@github.com/w3c/wcag-act-rules.git#a60a4e62f2eea5021cf20470fb908ae812aa7fb5", + "version": "git+ssh://git@github.com/w3c/wcag-act-rules.git#9416ea60714ed6c916435c7b38db76062f3ef004", "dev": true, - "from": "wcag-act-rules@github:w3c/wcag-act-rules#a60a4e62f2" + "from": "wcag-act-rules@github:w3c/wcag-act-rules#9416ea6" }, "weakmap-polyfill": { "version": "2.0.4", diff --git a/package.json b/package.json index 84a8b54d2b..5ec1c3deeb 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/act-rules/act-runner.js b/test/act-rules/act-runner.js index 7391646637..024beb6dec 100644 --- a/test/act-rules/act-runner.js +++ b/test/act-rules/act-runner.js @@ -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); } }); diff --git a/test/act-rules/aria-required-context-ff89c9.spec.js b/test/act-rules/aria-required-context-ff89c9.spec.js new file mode 100644 index 0000000000..d4e6a5de4b --- /dev/null +++ b/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'] +}); diff --git a/test/act-rules/aria-required-owned-element-bc4a75.spec.js b/test/act-rules/aria-required-owned-element-bc4a75.spec.js index 3344b5bcc5..b5faa0d2b1 100644 --- a/test/act-rules/aria-required-owned-element-bc4a75.spec.js +++ b/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'] }); diff --git a/test/act-rules/form-field-non-empty-accessible-name-e086e5.spec.js b/test/act-rules/form-field-non-empty-accessible-name-e086e5.spec.js index a58748d938..6bbd2b4d10 100644 --- a/test/act-rules/form-field-non-empty-accessible-name-e086e5.spec.js +++ b/test/act-rules/form-field-non-empty-accessible-name-e086e5.spec.js @@ -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'] });