Skip to content

Commit 9d21c3e

Browse files
committed
[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 e5dda96 commit 9d21c3e

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ ruleTester.run('role-has-required-aria-props', rule, {
6969
{ code: '<input role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" {...props} type="checkbox" />' },
7070
{ code: '<input type="checkbox" role="switch" />' },
7171
{ code: '<MyComponent role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" />', settings: componentsSettings },
72+
{ code: '<div role="heading" aria-level={2} />' },
73+
{ code: '<div role="heading" aria-level="3" />' },
7274
)).concat(basicValidityTests).map(parserOptionsMapper),
7375

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

0 commit comments

Comments
 (0)