|
1 | 1 | describe('dom.isVisible', function() {
|
2 | 2 | 'use strict';
|
| 3 | + |
3 | 4 | var fixture = document.getElementById('fixture');
|
| 5 | + var fixtureSetup = axe.testUtils.fixtureSetup; |
4 | 6 | var shadowSupported = axe.testUtils.shadowSupport.v1;
|
5 | 7 | var fakeNode = {
|
6 | 8 | nodeType: Node.ELEMENT_NODE,
|
@@ -78,6 +80,33 @@ describe('dom.isVisible', function() {
|
78 | 80 | assert.isTrue(axe.commons.dom.isVisible(document));
|
79 | 81 | });
|
80 | 82 |
|
| 83 | + it('should return false on STYLE tag', function() { |
| 84 | + var fixture = fixtureSetup( |
| 85 | + '<style id="target"> @import "https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css"; .green { background-color: green; } </style>' |
| 86 | + ); |
| 87 | + var node = fixture.querySelector('#target'); |
| 88 | + var actual = axe.commons.dom.isVisible(node); |
| 89 | + assert.isFalse(actual); |
| 90 | + }); |
| 91 | + |
| 92 | + it('should return false on NOSCRIPT tag', function() { |
| 93 | + var fixture = fixtureSetup( |
| 94 | + '<noscript id="target"><p class="invisible"><img src="/piwik/piwik.php?idsite=1" alt="" /></p></noscript>' |
| 95 | + ); |
| 96 | + var node = fixture.querySelector('#target'); |
| 97 | + var actual = axe.commons.dom.isVisible(node); |
| 98 | + assert.isFalse(actual); |
| 99 | + }); |
| 100 | + |
| 101 | + it('should return false on TEMPLATE tag', function() { |
| 102 | + var fixture = fixtureSetup( |
| 103 | + '<template id="target"><div>Name:</div></template>' |
| 104 | + ); |
| 105 | + var node = fixture.querySelector('#target'); |
| 106 | + var actual = axe.commons.dom.isVisible(node); |
| 107 | + assert.isFalse(actual); |
| 108 | + }); |
| 109 | + |
81 | 110 | it('should return true if positioned staticly but top/left is set', function() {
|
82 | 111 | fixture.innerHTML =
|
83 | 112 | '<div id="target" style="top: -9999px; left: -9999px;' +
|
|
0 commit comments