Skip to content

Commit

Permalink
fix: whitespace in hidden-content test
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed Jul 4, 2017
1 parent 2beede6 commit 99e8b73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/checks/visibility/hidden-content.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('hidden content', function () {
'use strict';

var fixture = document.getElementById('fixture');
var fixture = document.getElementById('fixture');

var checkContext = {
_data: null,
Expand All @@ -12,7 +12,7 @@ describe('hidden content', function () {

function checkSetup (html, options, target) {
fixture.innerHTML = html;
axe._tree = axe.utils.getFlattenedTree(fixture);
axe._tree = axe.utils.getFlattenedTree(fixture);
var node = fixture.querySelector(target || '#target');
var virtualNode = axe.utils.getNodeFromTree(axe._tree[0], node);
return [node, options, virtualNode];
Expand All @@ -25,17 +25,17 @@ describe('hidden content', function () {
});

it('should return undefined with display:none and children', function () {
var params = checkSetup('<div id="target" style="display: none;"><p>Some paragraph text.</p></div>');
var params = checkSetup('<div id="target" style="display: none;"><p>Some paragraph text.</p></div>');
assert.isUndefined(checks['hidden-content'].evaluate.apply(checkContext, params));
});

it('should return undefined with visibility:hidden and children', function () {
var params = checkSetup('<div id="target" style="visibility: hidden;"><p>Some paragraph text.</p></div>');
var params = checkSetup('<div id="target" style="visibility: hidden;"><p>Some paragraph text.</p></div>');
assert.isUndefined(checks['hidden-content'].evaluate.apply(checkContext, params));
});

it('should return true with visibility:hidden and parent with visibility:hidden', function () {
var params = checkSetup('<div style="visibility: hidden;"><p id="target" style="visibility: hidden;">Some paragraph text.</p></div>');
var params = checkSetup('<div style="visibility: hidden;"><p id="target" style="visibility: hidden;">Some paragraph text.</p></div>');
assert.isTrue(checks['hidden-content'].evaluate.apply(checkContext, params));
});

Expand All @@ -46,7 +46,7 @@ describe('hidden content', function () {

it('should skip whitelisted elements', function () {
var node = document.querySelector('head');
axe._tree = axe.utils.getFlattenedTree(document.documentElement);
axe._tree = axe.utils.getFlattenedTree(document.documentElement);
var virtualNode = axe.utils.getNodeFromTree(axe._tree[0], node);
assert.isTrue(checks['hidden-content'].evaluate.call(checkContext, node, undefined, virtualNode));
});
Expand Down

0 comments on commit 99e8b73

Please sign in to comment.