-
Notifications
You must be signed in to change notification settings - Fork 795
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-h1): allow aria-level=1 on native headings (#2349)
- Loading branch information
1 parent
49fdb46
commit 70b10b2
Showing
19 changed files
with
457 additions
and
10 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
2 changes: 1 addition & 1 deletion
2
test/integration/full/page-has-heading-one/page-has-heading-one-pass1.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
2 changes: 1 addition & 1 deletion
2
test/integration/full/page-has-heading-one/page-has-heading-one-pass2.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass1"> | ||
<html lang="en" id="pass2"> | ||
<head> | ||
<meta charset="utf8" /> | ||
<link | ||
|
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
2 changes: 1 addition & 1 deletion
2
test/integration/full/page-has-heading-one/page-has-heading-one-pass3.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass1"> | ||
<html lang="en" id="pass3"> | ||
<head> | ||
<meta charset="utf8" /> | ||
<link | ||
|
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
28 changes: 28 additions & 0 deletions
28
test/integration/full/page-has-heading-one/page-has-heading-one-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,28 @@ | ||
<!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> | ||
<h2 aria-level="1">Level one heading!</h2> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="page-has-heading-one-pass4.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-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,46 @@ | ||
describe('page-has-heading-one test pass 4', 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 #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); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
test/integration/full/page-has-heading-one/page-has-heading-one-pass5.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,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass5"> | ||
<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> | ||
<h3 aria-level="1">Level one heading!</h3> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="page-has-heading-one-pass5.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-pass5.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 5', 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 #pass5', function() { | ||
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass5']); | ||
}); | ||
}); | ||
|
||
it('should find 0 inapplicable', function() { | ||
assert.lengthOf(results.inapplicable, 0); | ||
}); | ||
|
||
it('should find 0 incomplete', function() { | ||
assert.lengthOf(results.incomplete, 0); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
test/integration/full/page-has-heading-one/page-has-heading-one-pass6.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,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass6"> | ||
<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> | ||
<h4 aria-level="1">Level one heading!</h4> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="page-has-heading-one-pass6.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-pass6.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 6', 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 #pass6', function() { | ||
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass6']); | ||
}); | ||
}); | ||
|
||
it('should find 0 inapplicable', function() { | ||
assert.lengthOf(results.inapplicable, 0); | ||
}); | ||
|
||
it('should find 0 incomplete', function() { | ||
assert.lengthOf(results.incomplete, 0); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
test/integration/full/page-has-heading-one/page-has-heading-one-pass7.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,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" id="pass7"> | ||
<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> | ||
<h5 aria-level="1">Level one heading!</h5> | ||
<div id="mocha"></div> | ||
<script src="/test/testutils.js"></script> | ||
<script src="page-has-heading-one-pass7.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-pass7.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 7', 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 #pass7', function() { | ||
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass7']); | ||
}); | ||
}); | ||
|
||
it('should find 0 inapplicable', function() { | ||
assert.lengthOf(results.inapplicable, 0); | ||
}); | ||
|
||
it('should find 0 incomplete', function() { | ||
assert.lengthOf(results.incomplete, 0); | ||
}); | ||
}); |
Oops, something went wrong.