-
Notifications
You must be signed in to change notification settings - Fork 743
/
page-has-heading-one-pass3.js
46 lines (40 loc) · 1.06 KB
/
page-has-heading-one-pass3.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('page-has-heading-one test pass', function() {
'use strict';
var results;
before(function(done) {
axe.testUtils.awaitNestedLoad(function() {
// Stop messing with my tests Mocha!
var heading = document.querySelector('#mocha h1');
if (heading) {
heading.outerHTML = '<h2>page-has-heading-one test</h2>';
}
axe.run(
{ runOnly: { type: 'rule', values: ['page-has-heading-one'] } },
function(err, r) {
assert.isNull(err);
results = r;
done();
}
);
});
});
describe('violations', function() {
it('should find 0', function() {
assert.lengthOf(results.violations, 0);
});
});
describe('passes', function() {
it('should find 1', function() {
assert.lengthOf(results.passes[0].nodes, 1);
});
it('should find #pass1', function() {
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass1']);
});
});
it('should find 0 inapplicable', function() {
assert.lengthOf(results.inapplicable, 0);
});
it('should find 0 incomplete', function() {
assert.lengthOf(results.incomplete, 0);
});
});