-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(page-has-heading-one,landmark-one-main): do not fail if modal is …
…open (#3501)
- Loading branch information
Showing
7 changed files
with
161 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/integration/full/landmark-one-main/landmark-one-main-pass4.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass4"> | ||
<head> | ||
<meta charset="utf8" /> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="/node_modules/mocha/mocha.css" | ||
/> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script src="/node_modules/chai/chai.js"></script> | ||
<script src="/axe.js"></script> | ||
<script> | ||
mocha.setup({ | ||
timeout: 10000, | ||
ui: 'bdd' | ||
}); | ||
var assert = chai.assert; | ||
</script> | ||
</head> | ||
<body> | ||
<main aria-hidden="true"> | ||
<h1>Level one heading!</h1> | ||
</main> | ||
<div role="dialog"> | ||
Modal open | ||
</div> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="landmark-one-main-pass4.js"></script> | ||
<script src="/test/integration/adapter.js"></script> | ||
</body> | ||
</html> |
40 changes: 40 additions & 0 deletions
40
test/integration/full/landmark-one-main/landmark-one-main-pass4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
describe('landmark-one-main test pass', function() { | ||
'use strict'; | ||
var results; | ||
before(function(done) { | ||
axe.testUtils.awaitNestedLoad(function() { | ||
axe.run( | ||
{ runOnly: { type: 'rule', values: ['landmark-one-main'] } }, | ||
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 #pass4', function() { | ||
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass4']); | ||
}); | ||
}); | ||
|
||
it('should find 0 inapplicable', function() { | ||
assert.lengthOf(results.inapplicable, 0); | ||
}); | ||
|
||
it('should find 0 incomplete', function() { | ||
assert.lengthOf(results.incomplete, 0); | ||
}); | ||
}); |
33 changes: 33 additions & 0 deletions
33
test/integration/full/page-has-heading-one/page-has-heading-one-pass10.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass10"> | ||
<head> | ||
<meta charset="utf8" /> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="/node_modules/mocha/mocha.css" | ||
/> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script src="/node_modules/chai/chai.js"></script> | ||
<script src="/axe.js"></script> | ||
<script> | ||
mocha.setup({ | ||
timeout: 10000, | ||
ui: 'bdd' | ||
}); | ||
var assert = chai.assert; | ||
</script> | ||
</head> | ||
<body> | ||
<main aria-hidden="true"> | ||
<h1>Level one heading!</h1> | ||
</main> | ||
<div role="dialog"> | ||
Modal open | ||
</div> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="page-has-heading-one-pass10.js"></script> | ||
<script src="/test/integration/adapter.js"></script> | ||
</body> | ||
</html> |
46 changes: 46 additions & 0 deletions
46
test/integration/full/page-has-heading-one/page-has-heading-one-pass10.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
describe('page-has-heading-one test pass 2', 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 #pass10', function() { | ||
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass10']); | ||
}); | ||
}); | ||
|
||
it('should find 0 inapplicable', function() { | ||
assert.lengthOf(results.inapplicable, 0); | ||
}); | ||
|
||
it('should find 0 incomplete', function() { | ||
assert.lengthOf(results.incomplete, 0); | ||
}); | ||
}); |