From cb019755d9cb52b997aae340f406ac26d0cf90e5 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Fri, 8 Oct 2021 09:33:11 -0600 Subject: [PATCH] fix(aria-allowed-children,aria-allowed-parent): allow group role in listbox (#3195) * fix(aria-allowed-children,aria-allowed-parent): allow group role in listbox * fix tests --- lib/standards/aria-roles.js | 4 ++-- test/checks/aria/required-children.js | 2 +- .../aria-required-children/aria-required-children.html | 6 ++++++ .../aria-required-children/aria-required-children.json | 3 ++- .../rules/aria-required-parent/aria-required-parent.html | 6 ++++++ .../rules/aria-required-parent/aria-required-parent.json | 3 ++- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index a21fe4a2b1..f1291d37f0 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -284,7 +284,7 @@ const ariaRoles = { }, listbox: { type: 'composite', - requiredOwned: ['option'], + requiredOwned: ['group', 'option'], allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', @@ -418,7 +418,7 @@ const ariaRoles = { }, option: { type: 'widget', - requiredContext: ['listbox'], + requiredContext: ['group', 'listbox'], // Note: since the option role has an implicit // aria-selected value it is not required to be added by // the user diff --git a/test/checks/aria/required-children.js b/test/checks/aria/required-children.js index 38e1ccaae9..c5fba9de19 100644 --- a/test/checks/aria/required-children.js +++ b/test/checks/aria/required-children.js @@ -323,7 +323,7 @@ describe('aria-required-children', function() { it('should fail when role does not allow group', function() { var params = checkSetup( - '