-
Notifications
You must be signed in to change notification settings - Fork 800
/
Copy pathautocomplete-valid.js
43 lines (38 loc) · 1.16 KB
/
autocomplete-valid.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
describe('autocomplete-valid virtual-rule', function () {
it('should pass when autocomplete is valid', function () {
var results = axe.runVirtualRule('autocomplete-valid', {
nodeName: 'input',
attributes: {
type: 'text',
autocomplete: 'country-name'
}
});
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.incomplete, 0);
});
it('should pass when autocomplete is correctly used', function () {
var results = axe.runVirtualRule('autocomplete-valid', {
nodeName: 'input',
attributes: {
type: 'text',
autocomplete: 'email'
}
});
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.incomplete, 0);
});
it('should fail autocomplete is not valid', function () {
var results = axe.runVirtualRule('autocomplete-valid', {
nodeName: 'input',
attributes: {
type: 'text',
autocomplete: 'foobar'
}
});
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.incomplete, 0);
});
});