-
Notifications
You must be signed in to change notification settings - Fork 804
/
Copy pathtabindex.js
46 lines (38 loc) · 1.04 KB
/
tabindex.js
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', function () {
it('should pass for tabindex = 0', function () {
var node = {
nodeName: 'div',
attributes: {
tabindex: 0
}
};
var 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', function () {
var node = {
nodeName: 'div',
attributes: {
tabindex: -1
}
};
var 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', function () {
var node = {
nodeName: 'div',
attributes: {
tabindex: 1
}
};
var results = axe.runVirtualRule('tabindex', node);
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.incomplete, 0);
});
});