Skip to content

Commit

Permalink
[Tests] Add tests to reinforce required attributes for role="heading"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lb- authored and ljharb committed Oct 23, 2024
1 parent aa075bd commit d92446c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions __tests__/src/rules/role-has-required-aria-props-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ ruleTester.run('role-has-required-aria-props', rule, {
{ code: '<input role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" {...props} type="checkbox" />' },
{ code: '<input type="checkbox" role="switch" />' },
{ code: '<MyComponent role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0" />', settings: componentsSettings },
{ code: '<div role="heading" aria-level={2} />' },
{ code: '<div role="heading" aria-level="3" />' },
)).concat(basicValidityTests).map(parserOptionsMapper),

invalid: parsers.all([].concat(
Expand Down

0 comments on commit d92446c

Please sign in to comment.