Skip to content

Commit d92446c

Browse files
lb-ljharb
authored andcommitted
[Tests] Add tests to reinforce required attributes for role="heading"
Add unit tests to ensure that there are no warnings when role="heading" is used when aria-level is provided. For example, aria-label is not required. See #1002
1 parent aa075bd commit d92446c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

__tests__/src/rules/role-has-required-aria-props-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ ruleTester.run('role-has-required-aria-props', rule, {
6666
{ code: '<input role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" {...props} type="checkbox" />' },
6767
{ code: '<input type="checkbox" role="switch" />' },
6868
{ code: '<MyComponent role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" />', settings: componentsSettings },
69+
{ code: '<div role="heading" aria-level={2} />' },
70+
{ code: '<div role="heading" aria-level="3" />' },
6971
)).concat(basicValidityTests).map(parserOptionsMapper),
7072

7173
invalid: parsers.all([].concat(

0 commit comments

Comments
 (0)