diff --git a/lib/rules/html-lang-valid.json b/lib/rules/html-lang-valid.json index 71115a6007..050b10f605 100644 --- a/lib/rules/html-lang-valid.json +++ b/lib/rules/html-lang-valid.json @@ -1,6 +1,6 @@ { "id": "html-lang-valid", - "selector": "html[lang]", + "selector": "html[lang], html[xml\\:lang]", "tags": [ "cat.language", "wcag2a", diff --git a/test/integration/full/html-lang-valid/frames/level1.html b/test/integration/full/html-lang-valid/frames/level1.html index 644f7ce0df..af5b58fa40 100644 --- a/test/integration/full/html-lang-valid/frames/level1.html +++ b/test/integration/full/html-lang-valid/frames/level1.html @@ -8,5 +8,7 @@ + + diff --git a/test/integration/full/html-lang-valid/frames/level2-b.html b/test/integration/full/html-lang-valid/frames/level2-b.html new file mode 100644 index 0000000000..fbd8390b7d --- /dev/null +++ b/test/integration/full/html-lang-valid/frames/level2-b.html @@ -0,0 +1,11 @@ + + + + No lang test + + + + + Hi + + diff --git a/test/integration/full/html-lang-valid/frames/level2-c.html b/test/integration/full/html-lang-valid/frames/level2-c.html new file mode 100644 index 0000000000..8cc3b292e9 --- /dev/null +++ b/test/integration/full/html-lang-valid/frames/level2-c.html @@ -0,0 +1,11 @@ + + + + No lang test + + + + + Hi + + diff --git a/test/integration/full/html-lang-valid/html-lang-valid.html b/test/integration/full/html-lang-valid/html-lang-valid.html index a4242c0bd4..e1cb33dee1 100644 --- a/test/integration/full/html-lang-valid/html-lang-valid.html +++ b/test/integration/full/html-lang-valid/html-lang-valid.html @@ -1,5 +1,6 @@ + html-lang-valid test @@ -16,10 +17,12 @@ var assert = chai.assert; +
+ diff --git a/test/integration/full/html-lang-valid/html-lang-valid.js b/test/integration/full/html-lang-valid/html-lang-valid.js index 63676a8539..a7e75d8afe 100644 --- a/test/integration/full/html-lang-valid/html-lang-valid.js +++ b/test/integration/full/html-lang-valid/html-lang-valid.js @@ -1,6 +1,8 @@ describe('html-lang-valid test', function() { 'use strict'; + var results; + before(function(done) { axe.testUtils.awaitNestedLoad(function() { axe.run( @@ -15,15 +17,17 @@ describe('html-lang-valid test', function() { }); describe('violations', function() { - it('should find 2', function() { - assert.lengthOf(results.violations[0].nodes, 2); + it('should find 3', function() { + assert.lengthOf(results.violations[0].nodes, 3); }); + it('should find first level iframe', function() { assert.deepEqual(results.violations[0].nodes[0].target, [ '#frame1', '#violation1' ]); }); + it('should find second level iframe', function() { assert.deepEqual(results.violations[0].nodes[1].target, [ '#frame1', @@ -31,11 +35,19 @@ describe('html-lang-valid test', function() { '#violation2' ]); }); + + it('should find #violation2c', function() { + assert.deepEqual(results.violations[0].nodes[2].target, [ + '#frame1', + '#frame5', + '#violation2c' + ]); + }); }); describe('passes', function() { - it('should find 1', function() { - assert.lengthOf(results.passes[0].nodes, 1); + it('should find 2', function() { + assert.lengthOf(results.passes[0].nodes, 2); }); it('should find #pass1', function() { @@ -45,5 +57,13 @@ describe('html-lang-valid test', function() { '#pass1' ]); }); + + it('should find #pass2b', function() { + assert.deepEqual(results.passes[0].nodes[1].target, [ + '#frame1', + '#frame4', + '#pass2b' + ]); + }); }); });