Skip to content

Commit

Permalink
Merge pull request #707 from jsx-eslint/690-fix
Browse files Browse the repository at this point in the history
Additional test case for no-redundant-roles
  • Loading branch information
jessebeach authored Jun 21, 2020
2 parents 79559b8 + 2707a31 commit 85801bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions __tests__/src/rules/no-redundant-roles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ruleTester.run(`${ruleName}:recommended`, rule, {
});

const noNavExceptionsOptions = { nav: [] };
const listException = { ul: ['list'], ol: ['list'] };

ruleTester.run(`${ruleName}:recommended`, rule, {
valid: alwaysValid
Expand All @@ -62,3 +63,17 @@ ruleTester.run(`${ruleName}:recommended`, rule, {
.map(ruleOptionsMapperFactory(noNavExceptionsOptions))
.map(parserOptionsMapper),
});

ruleTester.run(`${ruleName}:recommended (valid list role override)`, rule, {
valid: [
{ code: '<ul role="list" />' },
{ code: '<ol role="list" />' },
]
.map(ruleOptionsMapperFactory(listException))
.map(parserOptionsMapper),
invalid: [
{ code: '<ul role="list" />', errors: [expectedError('ul', 'list')] },
{ code: '<ol role="list" />', errors: [expectedError('ol', 'list')] },
]
.map(parserOptionsMapper),
});

0 comments on commit 85801bd

Please sign in to comment.