diff --git a/lib/checks/keyboard/page-has-elm.js b/lib/checks/keyboard/page-has-elm.js
index f0be48274c..d8d7d5715b 100644
--- a/lib/checks/keyboard/page-has-elm.js
+++ b/lib/checks/keyboard/page-has-elm.js
@@ -7,7 +7,7 @@ if (!options || !options.selector || typeof options.selector !== 'string') {
const matchingElms = axe.utils.querySelectorAllFilter(
virtualNode,
options.selector,
- vNode => axe.commons.dom.isVisible(vNode.actualNode)
+ vNode => axe.commons.dom.isVisible(vNode.actualNode, true)
);
this.relatedNodes(matchingElms.map(vNode => vNode.actualNode));
return matchingElms.length > 0;
diff --git a/test/checks/keyboard/page-has-elm.js b/test/checks/keyboard/page-has-elm.js
index 6796c53990..ee4deacdfe 100644
--- a/test/checks/keyboard/page-has-elm.js
+++ b/test/checks/keyboard/page-has-elm.js
@@ -54,6 +54,30 @@ describe('page-has-*', function() {
);
assert.isFalse(evaluate.apply(checkContext, params));
});
+
+ it('does find screen-reader only elements', function() {
+ var options = { selector: 'b' };
+ var params = checkSetup(
+ '' +
+ '
No role
',
+ options
+ );
+ assert.isTrue(evaluate.apply(checkContext, params));
+ });
});
describe('after', function() {
diff --git a/test/integration/full/landmark-one-main/landmark-one-main-pass3.html b/test/integration/full/landmark-one-main/landmark-one-main-pass3.html
new file mode 100644
index 0000000000..333c8cc95f
--- /dev/null
+++ b/test/integration/full/landmark-one-main/landmark-one-main-pass3.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Main content
+
+
+
+
+
+
+
diff --git a/test/integration/full/landmark-one-main/landmark-one-main-pass3.js b/test/integration/full/landmark-one-main/landmark-one-main-pass3.js
new file mode 100644
index 0000000000..e18612ebb1
--- /dev/null
+++ b/test/integration/full/landmark-one-main/landmark-one-main-pass3.js
@@ -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 #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);
+ });
+});
diff --git a/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.html b/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.html
new file mode 100644
index 0000000000..36a6f5be12
--- /dev/null
+++ b/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Level one heading!
+
+
+
+
+
+
diff --git a/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.js b/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.js
new file mode 100644
index 0000000000..ca9f12684b
--- /dev/null
+++ b/test/integration/full/page-has-heading-one/page-has-heading-one-pass3.js
@@ -0,0 +1,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 = 'page-has-heading-one test
';
+ }
+
+ 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);
+ });
+});