forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabindex.js
More file actions
46 lines (38 loc) · 1.03 KB
/
Copy pathtabindex.js
File metadata and controls
46 lines (38 loc) · 1.03 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
describe('tabindex virtual-rule', () => {
it('should pass for tabindex = 0', () => {
const node = {
nodeName: 'div',
attributes: {
tabindex: 0
}
};
const results = axe.runVirtualRule('tabindex', node);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.incomplete, 0);
});
it('should pass for tabindex = -1', () => {
const node = {
nodeName: 'div',
attributes: {
tabindex: -1
}
};
const results = axe.runVirtualRule('tabindex', node);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.incomplete, 0);
});
it('should fail for tabindex > 0', () => {
const node = {
nodeName: 'div',
attributes: {
tabindex: 1
}
};
const results = axe.runVirtualRule('tabindex', node);
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.incomplete, 0);
});
});