From 15df9929ebba74cd1137f0647c0e5249461420bb Mon Sep 17 00:00:00 2001 From: Rebecca Weber Date: Tue, 6 Apr 2021 16:21:13 -0400 Subject: [PATCH 1/2] feat(rule): add ACT Rule IDs to test rule objects (#2820) --- build/tasks/validate.js | 6 ++++++ lib/rules/area-alt.json | 1 + lib/rules/aria-allowed-attr.json | 1 + lib/rules/aria-command-name.json | 1 + lib/rules/aria-hidden-focus.json | 1 + lib/rules/aria-input-field-name.json | 1 + lib/rules/aria-required-children.json | 1 + lib/rules/aria-required-parent.json | 1 + lib/rules/aria-valid-attr-value.json | 1 + lib/rules/audio-caption.json | 1 + lib/rules/autocomplete-valid.json | 1 + lib/rules/button-name.json | 1 + lib/rules/css-orientation-lock.json | 1 + lib/rules/document-title.json | 1 + lib/rules/duplicate-id-aria.json | 1 + lib/rules/html-has-lang.json | 1 + lib/rules/html-lang-valid.json | 1 + lib/rules/html-xml-lang-mismatch.json | 1 + lib/rules/identical-links-same-purpose.json | 1 + lib/rules/image-alt.json | 1 + lib/rules/input-image-alt.json | 1 + lib/rules/label-content-name-mismatch.json | 1 + lib/rules/label.json | 1 + lib/rules/link-name.json | 1 + lib/rules/meta-viewport.json | 1 + lib/rules/nested-interactive.json | 1 + lib/rules/no-autoplay-audio.json | 1 + lib/rules/object-alt.json | 1 + lib/rules/role-img-alt.json | 1 + lib/rules/scrollable-region-focusable.json | 1 + lib/rules/select-name.json | 1 + lib/rules/svg-img-alt.json | 1 + lib/rules/td-headers-attr.json | 1 + lib/rules/th-has-data-cells.json | 1 + lib/rules/video-caption.json | 1 + 35 files changed, 40 insertions(+) diff --git a/build/tasks/validate.js b/build/tasks/validate.js index 00750f554e..542799a40b 100644 --- a/build/tasks/validate.js +++ b/build/tasks/validate.js @@ -206,6 +206,12 @@ function createSchemas() { conform: 'must include a category tag' } }, + actIds: { + type: 'array', + items: { + type: 'string' + } + }, matches: { type: 'string', required: false, diff --git a/lib/rules/area-alt.json b/lib/rules/area-alt.json index 4e0c2fdd9e..dd77216bb9 100644 --- a/lib/rules/area-alt.json +++ b/lib/rules/area-alt.json @@ -12,6 +12,7 @@ "section508.22.a", "ACT" ], + "actIds": ["c487ae"], "metadata": { "description": "Ensures elements of image maps have alternate text", "help": "Active elements must have alternate text" diff --git a/lib/rules/aria-allowed-attr.json b/lib/rules/aria-allowed-attr.json index 36b197f8e1..19f705bf85 100644 --- a/lib/rules/aria-allowed-attr.json +++ b/lib/rules/aria-allowed-attr.json @@ -2,6 +2,7 @@ "id": "aria-allowed-attr", "matches": "aria-allowed-attr-matches", "tags": ["cat.aria", "wcag2a", "wcag412"], + "actIds": ["5c01ea"], "metadata": { "description": "Ensures ARIA attributes are allowed for an element's role", "help": "Elements must only use allowed ARIA attributes" diff --git a/lib/rules/aria-command-name.json b/lib/rules/aria-command-name.json index b38b8cb815..65d068fb5c 100644 --- a/lib/rules/aria-command-name.json +++ b/lib/rules/aria-command-name.json @@ -3,6 +3,7 @@ "selector": "[role=\"link\"], [role=\"button\"], [role=\"menuitem\"]", "matches": "no-naming-method-matches", "tags": ["cat.aria", "wcag2a", "wcag412"], + "actIds": ["97a4e1"], "metadata": { "description": "Ensures every ARIA button, link and menuitem has an accessible name", "help": "ARIA commands must have an accessible name" diff --git a/lib/rules/aria-hidden-focus.json b/lib/rules/aria-hidden-focus.json index 0a6587ea8c..3b15bfad7b 100755 --- a/lib/rules/aria-hidden-focus.json +++ b/lib/rules/aria-hidden-focus.json @@ -4,6 +4,7 @@ "matches": "aria-hidden-focus-matches", "excludeHidden": false, "tags": ["cat.name-role-value", "wcag2a", "wcag412", "wcag131"], + "actIds": ["6cfa84"], "metadata": { "description": "Ensures aria-hidden elements do not contain focusable elements", "help": "ARIA hidden element must not contain focusable elements" diff --git a/lib/rules/aria-input-field-name.json b/lib/rules/aria-input-field-name.json index 199e6bc8ac..4efe53b556 100644 --- a/lib/rules/aria-input-field-name.json +++ b/lib/rules/aria-input-field-name.json @@ -3,6 +3,7 @@ "selector": "[role=\"combobox\"], [role=\"listbox\"], [role=\"searchbox\"], [role=\"slider\"], [role=\"spinbutton\"], [role=\"textbox\"]", "matches": "no-naming-method-matches", "tags": ["cat.aria", "wcag2a", "wcag412", "ACT"], + "actIds": ["e086e5"], "metadata": { "description": "Ensures every ARIA input field has an accessible name", "help": "ARIA input fields must have an accessible name" diff --git a/lib/rules/aria-required-children.json b/lib/rules/aria-required-children.json index 6d7527665b..fba7b76324 100644 --- a/lib/rules/aria-required-children.json +++ b/lib/rules/aria-required-children.json @@ -3,6 +3,7 @@ "selector": "[role]", "matches": "aria-required-children-matches", "tags": ["cat.aria", "wcag2a", "wcag131"], + "actIds": ["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/lib/rules/aria-required-parent.json b/lib/rules/aria-required-parent.json index 2a41fa8e9c..54de251b4e 100644 --- a/lib/rules/aria-required-parent.json +++ b/lib/rules/aria-required-parent.json @@ -3,6 +3,7 @@ "selector": "[role]", "matches": "aria-required-parent-matches", "tags": ["cat.aria", "wcag2a", "wcag131"], + "actIds": ["bc4a75", "ff89c9"], "metadata": { "description": "Ensures elements with an ARIA role that require parent roles are contained by them", "help": "Certain ARIA roles must be contained by particular parents" diff --git a/lib/rules/aria-valid-attr-value.json b/lib/rules/aria-valid-attr-value.json index b4607c525d..126b582990 100644 --- a/lib/rules/aria-valid-attr-value.json +++ b/lib/rules/aria-valid-attr-value.json @@ -2,6 +2,7 @@ "id": "aria-valid-attr-value", "matches": "aria-has-attr-matches", "tags": ["cat.aria", "wcag2a", "wcag412"], + "actIds": ["5c01ea", "c487ae"], "metadata": { "description": "Ensures all ARIA attributes have valid values", "help": "ARIA attributes must conform to valid values" diff --git a/lib/rules/audio-caption.json b/lib/rules/audio-caption.json index fc026dd212..fac50b06a3 100644 --- a/lib/rules/audio-caption.json +++ b/lib/rules/audio-caption.json @@ -10,6 +10,7 @@ "section508", "section508.22.a" ], + "actIds": ["c3232f", "e7aa44"], "metadata": { "description": "Ensures