forked from vue-a11y/eslint-plugin-vuejs-accessibility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathno-role-presentation-on-focusable.test.ts
31 lines (30 loc) · 1.1 KB
/
no-role-presentation-on-focusable.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import rule from '../no-role-presentation-on-focusable';
import makeRuleTester from "./makeRuleTester";
makeRuleTester('no-role-presentation-role-on-focusable', rule, {
valid: [
"<button>Submit</button>",
"<div role='presentation'><button tabindex='-1'>Some text</button></div>",
"<div><button>Submit</button></div>",
"<a href='#' tabindex='-1'>link</a>",
"<button tabindex='-1' role='presentation'>Press</button>",
"<div role='presentation'><a href='#' tabindex='-1'>Link</a></div>"
],
invalid: [
{
code: "<div role='presentation'><button>Submit</button></div>",
errors: [{messageId: "default"}]
},
{
code: "<button type='button' role='presentation'>Submit</button>",
errors: [{messageId: "default"}]
},
{
code: "<a href='#' role='presentation'>Link</a>",
errors: [{messageId: "default"}]
},
{
code: "<span tabindex='0' role='presentation'><em>Icon</em></span>",
errors: [{messageId: "default"}]
}
]
})