' +
'' +
@@ -276,7 +276,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if it has only one column', function() {
+ it('should be false if it has only one column', function () {
fixture.innerHTML =
'';
@@ -285,7 +285,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if it has only one row', function() {
+ it('should be false if it has only one row', function () {
fixture.innerHTML = '';
var node = fixture.querySelector('table');
@@ -293,7 +293,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be true if it has 5 or more columns', function() {
+ it('should be true if it has 5 or more columns', function () {
fixture.innerHTML =
'' +
' ' +
@@ -305,7 +305,7 @@ describe('table.isDataTable', function() {
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if it has borders around cells', function() {
+ it('should be true if it has borders around cells', function () {
fixture.innerHTML =
'' +
' ' +
@@ -317,7 +317,7 @@ describe('table.isDataTable', function() {
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if it has zebra rows', function() {
+ it('should be true if it has zebra rows', function () {
fixture.innerHTML =
'' +
' ' +
@@ -330,7 +330,7 @@ describe('table.isDataTable', function() {
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if it has zebra rows - background image', function() {
+ it('should be true if it has zebra rows - background image', function () {
fixture.innerHTML =
'' +
' ' +
@@ -345,7 +345,7 @@ describe('table.isDataTable', function() {
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if it has 20 or more rows', function() {
+ it('should be true if it has 20 or more rows', function () {
fixture.innerHTML =
'' +
new Array(21).join(' ') +
@@ -355,7 +355,7 @@ describe('table.isDataTable', function() {
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be false if its width is 95% of the document width', function() {
+ it('should be false if its width is 95% of the document width', function () {
fixture.innerHTML =
'' +
new Array(3).join(' ') +
@@ -366,7 +366,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if it has less than 10 cells', function() {
+ it('should be false if it has less than 10 cells', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
@@ -377,7 +377,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if has an iframe element descendent', function() {
+ it('should be false if has an iframe element descendent', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
@@ -389,7 +389,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if has an object element descendent', function() {
+ it('should be false if has an object element descendent', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
@@ -401,7 +401,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if has an embed element descendent', function() {
+ it('should be false if has an embed element descendent', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
@@ -414,7 +414,7 @@ describe('table.isDataTable', function() {
});
// Causing sauce labs tests to fail & don't really care about applets
- it.skip('should be false if has an applet element descendent', function() {
+ it.skip('should be false if has an applet element descendent', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
@@ -426,7 +426,7 @@ describe('table.isDataTable', function() {
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should otherwise be true', function() {
+ it('should otherwise be true', function () {
fixture.innerHTML =
'' +
new Array(4).join(' ') +
diff --git a/test/commons/table/is-row-header.js b/test/commons/table/is-row-header.js
index 5be4318bee..1422663b2c 100644
--- a/test/commons/table/is-row-header.js
+++ b/test/commons/table/is-row-header.js
@@ -1,10 +1,10 @@
-describe('table.isRowHeader', function() {
+describe('table.isRowHeader', function () {
'use strict';
var table = axe.commons.table;
var fixtureSetup = axe.testUtils.fixtureSetup;
- beforeEach(function() {
+ beforeEach(function () {
fixtureSetup(
'' +
'' +
@@ -23,22 +23,22 @@ describe('table.isRowHeader', function() {
);
});
- it('returns false if not a row header', function() {
+ it('returns false if not a row header', function () {
var cell = document.querySelector('#cell1');
assert.isFalse(table.isRowHeader(cell));
});
- it('returns true if scope="auto"', function() {
+ it('returns true if scope="auto"', function () {
var cell = document.querySelector('#rh1');
assert.isTrue(table.isRowHeader(cell));
});
- it('returns false if scope="col"', function() {
+ it('returns false if scope="col"', function () {
var cell = document.querySelector('#ch1');
assert.isFalse(table.isRowHeader(cell));
});
- it('returns true if scope="row"', function() {
+ it('returns true if scope="row"', function () {
var cell = document.querySelector('#rh2');
assert.isTrue(table.isRowHeader(cell));
});
diff --git a/test/commons/table/to-grid.js b/test/commons/table/to-grid.js
index 38b78640f2..c23724e51c 100644
--- a/test/commons/table/to-grid.js
+++ b/test/commons/table/to-grid.js
@@ -1,4 +1,4 @@
-describe('table.toGrid', function() {
+describe('table.toGrid', function () {
'use strict';
function $id(id) {
return document.getElementById(id);
@@ -6,11 +6,11 @@ describe('table.toGrid', function() {
var fixture = $id('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should work', function() {
+ it('should work', function () {
fixture.innerHTML =
'' +
'2 ok ' +
@@ -25,7 +25,7 @@ describe('table.toGrid', function() {
]);
});
- it('should have cells with a width > 1 span more than one position', function() {
+ it('should have cells with a width > 1 span more than one position', function () {
fixture.innerHTML =
'' +
'2 ok ' +
@@ -40,7 +40,7 @@ describe('table.toGrid', function() {
]);
});
- it('should have cells with height > 1 occupy more than one row', function() {
+ it('should have cells with height > 1 occupy more than one row', function () {
fixture.innerHTML =
'' +
'2 ok ' +
@@ -55,7 +55,7 @@ describe('table.toGrid', function() {
]);
});
- it('should work with both col and rowspans', function() {
+ it('should work with both col and rowspans', function () {
fixture.innerHTML =
'' +
'2 ok ' +
@@ -70,7 +70,7 @@ describe('table.toGrid', function() {
]);
});
- it('should handle rowspan=0', function() {
+ it('should handle rowspan=0', function () {
fixture.innerHTML =
'' +
'2 ok ' +
@@ -85,7 +85,7 @@ describe('table.toGrid', function() {
]);
});
- it('should insert an empty array for empty rows', function() {
+ it('should insert an empty array for empty rows', function () {
fixture.innerHTML =
'';
diff --git a/test/commons/table/traverse.js b/test/commons/table/traverse.js
index c1fed8e3e2..4fc0079e8d 100644
--- a/test/commons/table/traverse.js
+++ b/test/commons/table/traverse.js
@@ -1,7 +1,7 @@
/* global fixture */
-describe('table.traverse', function() {
+describe('table.traverse', function () {
var table, dummyTable, topRight, bottomLeft;
- beforeEach(function() {
+ beforeEach(function () {
table = axe.commons.table;
dummyTable = [
['1a', '1b', '1c'],
@@ -12,92 +12,92 @@ describe('table.traverse', function() {
bottomLeft = { x: 2, y: 2 };
});
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('traverses in the `right` direction', function() {
+ it('traverses in the `right` direction', function () {
var iterations = 0;
var expect = ['1b', '1c'];
- table.traverse({ x: 1, y: 0 }, topRight, dummyTable, function(cell) {
+ table.traverse({ x: 1, y: 0 }, topRight, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
assert.equal(iterations, expect.length);
});
- it('returns an array of traversed cells', function() {
+ it('returns an array of traversed cells', function () {
var result = table.traverse({ x: 1, y: 0 }, topRight, dummyTable);
assert.deepEqual(result, ['1b', '1c']);
});
- it('traverses in the `down` direction', function() {
+ it('traverses in the `down` direction', function () {
var iterations = 0;
var expect = ['2a', '3a'];
- table.traverse({ x: 0, y: 1 }, topRight, dummyTable, function(cell) {
+ table.traverse({ x: 0, y: 1 }, topRight, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
assert.equal(iterations, expect.length);
});
- it('traverses in the `left` direction', function() {
+ it('traverses in the `left` direction', function () {
var iterations = 0;
var expect = ['3b', '3a'];
- table.traverse({ x: -1, y: 0 }, bottomLeft, dummyTable, function(cell) {
+ table.traverse({ x: -1, y: 0 }, bottomLeft, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
assert.equal(iterations, expect.length);
});
- it('traverses in the `up` direction', function() {
+ it('traverses in the `up` direction', function () {
var iterations = 0;
var expect = ['2c', '1c'];
- table.traverse({ x: 0, y: -1 }, bottomLeft, dummyTable, function(cell) {
+ table.traverse({ x: 0, y: -1 }, bottomLeft, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
assert.equal(iterations, expect.length);
});
- it('takes string values as directions', function() {
+ it('takes string values as directions', function () {
var iterations = 0;
var expect = ['1b', '1c'];
- table.traverse('right', topRight, dummyTable, function(cell) {
+ table.traverse('right', topRight, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
iterations = 0;
expect = ['2a', '3a'];
- table.traverse('down', topRight, dummyTable, function(cell) {
+ table.traverse('down', topRight, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
iterations = 0;
expect = ['3b', '3a'];
- table.traverse('left', bottomLeft, dummyTable, function(cell) {
+ table.traverse('left', bottomLeft, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
iterations = 0;
expect = ['2c', '1c'];
- table.traverse('up', bottomLeft, dummyTable, function(cell) {
+ table.traverse('up', bottomLeft, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
});
- it('stops when the callback returned true', function() {
+ it('stops when the callback returned true', function () {
var iterations = 0;
- table.traverse({ x: 1, y: 1 }, topRight, dummyTable, function(cell) {
+ table.traverse({ x: 1, y: 1 }, topRight, dummyTable, function (cell) {
assert.equal(cell, '2b'); // or not, to be?
iterations += 1;
return true;
@@ -105,11 +105,11 @@ describe('table.traverse', function() {
assert.equal(iterations, 1);
});
- it('starts at top-right of no position is given', function() {
+ it('starts at top-right of no position is given', function () {
var iterations = 0;
var expect = ['1b', '1c'];
- table.traverse({ x: 1, y: 0 }, dummyTable, function(cell) {
+ table.traverse({ x: 1, y: 0 }, dummyTable, function (cell) {
assert.equal(cell, expect[iterations]);
iterations += 1;
});
diff --git a/test/commons/text/is-human-interpretable.js b/test/commons/text/is-human-interpretable.js
index 801b93ca5a..5a4c022a8d 100644
--- a/test/commons/text/is-human-interpretable.js
+++ b/test/commons/text/is-human-interpretable.js
@@ -1,62 +1,62 @@
-describe('text.isHumanInterpretable', function() {
- it('returns 0 when given string is empty', function() {
+describe('text.isHumanInterpretable', function () {
+ it('returns 0 when given string is empty', function () {
var actual = axe.commons.text.isHumanInterpretable('');
assert.equal(actual, 0);
});
- it('returns 0 when given string is a single character that is blacklisted as icon', function() {
+ it('returns 0 when given string is a single character that is blacklisted as icon', function () {
var blacklistedIcons = ['x', 'i'];
- blacklistedIcons.forEach(function(iconText) {
+ blacklistedIcons.forEach(function (iconText) {
var actual = axe.commons.text.isHumanInterpretable(iconText);
assert.equal(actual, 0);
});
});
- it('returns 0 when given string is only punctuations', function() {
+ it('returns 0 when given string is only punctuations', function () {
var actual = axe.commons.text.isHumanInterpretable('?!!!,.');
assert.equal(actual, 0);
});
- it('returns 1 when given string has emoji as a part of the sentence', function() {
+ it('returns 1 when given string has emoji as a part of the sentence', function () {
var actual = axe.commons.text.isHumanInterpretable('I like 🏀');
assert.equal(actual, 1);
});
- it('returns 1 when given string has non BMP character (eg: windings font) as part of the sentence', function() {
+ it('returns 1 when given string has non BMP character (eg: windings font) as part of the sentence', function () {
var actual = axe.commons.text.isHumanInterpretable('I ✂ my hair');
assert.equal(actual, 1);
});
- it('returns 1 when given string has both non BMP character, and emoji as part of the sentence', function() {
+ it('returns 1 when given string has both non BMP character, and emoji as part of the sentence', function () {
var actual = axe.commons.text.isHumanInterpretable(
'I ✂ my hair, and I like 🏀'
);
assert.equal(actual, 1);
});
- it('returns 0 when given string has only emoji', function() {
+ it('returns 0 when given string has only emoji', function () {
var actual = axe.commons.text.isHumanInterpretable('🏀🍔🍉🎅');
assert.equal(actual, 0);
});
- it('returns 0 when given string has only non BNP characters', function() {
+ it('returns 0 when given string has only non BNP characters', function () {
var actual = axe.commons.text.isHumanInterpretable('⌛👓');
assert.equal(actual, 0);
});
- it('returns 0 when given string has combination of only non BNP characters and emojis', function() {
+ it('returns 0 when given string has combination of only non BNP characters and emojis', function () {
var actual = axe.commons.text.isHumanInterpretable('⌛👓🏀🍔🍉🎅');
assert.equal(actual, 0);
});
- it('returns 1 when given string is a punctuated sentence', function() {
+ it('returns 1 when given string is a punctuated sentence', function () {
var actual = axe.commons.text.isHumanInterpretable(
"I like football, but I prefer basketball; although I can't play either very well."
);
assert.equal(actual, 1);
});
- it('returns 1 for a sentence without emoji or punctuations', function() {
+ it('returns 1 for a sentence without emoji or punctuations', function () {
var actual = axe.commons.text.isHumanInterpretable('Earth is round');
assert.equal(actual, 1);
});
diff --git a/test/commons/text/is-icon-ligature.js b/test/commons/text/is-icon-ligature.js
index de9f9f6d1b..a28e000030 100644
--- a/test/commons/text/is-icon-ligature.js
+++ b/test/commons/text/is-icon-ligature.js
@@ -1,11 +1,11 @@
-describe('text.isIconLigature', function() {
+describe('text.isIconLigature', function () {
'use strict';
var isIconLigature = axe.commons.text.isIconLigature;
var queryFixture = axe.testUtils.queryFixture;
var fontApiSupport = !!document.fonts;
- before(function(done) {
+ before(function (done) {
if (!fontApiSupport) {
done();
}
@@ -29,7 +29,7 @@ describe('text.isIconLigature', function() {
ligatureFont.load(),
materialFont.load(),
robotoFont.load()
- ]).then(function() {
+ ]).then(function () {
document.fonts.add(firaFont);
document.fonts.add(ligatureFont);
document.fonts.add(materialFont);
@@ -38,29 +38,29 @@ describe('text.isIconLigature', function() {
});
});
- it('should return false for normal text', function() {
+ it('should return false for normal text', function () {
var target = queryFixture('Normal text
');
assert.isFalse(isIconLigature(target.children[0]));
});
- it('should return false for emoji', function() {
+ it('should return false for emoji', function () {
var target = queryFixture('🌎
');
assert.isFalse(isIconLigature(target.children[0]));
});
- it('should return false for non-bmp unicode', function() {
+ it('should return false for non-bmp unicode', function () {
var target = queryFixture('◓
');
assert.isFalse(isIconLigature(target.children[0]));
});
- it('should return false for whitespace strings', function() {
+ it('should return false for whitespace strings', function () {
var target = queryFixture('
');
assert.isFalse(isIconLigature(target.children[0]));
});
(fontApiSupport ? it : it.skip)(
'should return false for common ligatures (fi)',
- function() {
+ function () {
var target = queryFixture(
'figure
'
);
@@ -70,7 +70,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false for common ligatures (ff)',
- function() {
+ function () {
var target = queryFixture(
'ffugative
'
);
@@ -80,7 +80,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false for common ligatures (fl)',
- function() {
+ function () {
var target = queryFixture(
'flu shot
'
);
@@ -90,7 +90,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false for common ligatures (ffi)',
- function() {
+ function () {
var target = queryFixture(
'ffigure
'
);
@@ -100,7 +100,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false for common ligatures (ffl)',
- function() {
+ function () {
var target = queryFixture(
'fflu shot
'
);
@@ -110,7 +110,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return true for an icon ligature',
- function() {
+ function () {
var target = queryFixture(
'delete
'
);
@@ -118,7 +118,7 @@ describe('text.isIconLigature', function() {
}
);
- (fontApiSupport ? it : it.skip)('should trim the string', function() {
+ (fontApiSupport ? it : it.skip)('should trim the string', function () {
var target = queryFixture(
' fflu shot
'
);
@@ -127,7 +127,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return true for a font that has no character data',
- function() {
+ function () {
var target = queryFixture(
'f
'
);
@@ -137,7 +137,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false for a programming text ligature',
- function() {
+ function () {
var target = queryFixture(
'!==
'
);
@@ -147,7 +147,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return true for an icon ligature with low pixel difference',
- function() {
+ function () {
var target = queryFixture(
'keyboard_arrow_left
'
);
@@ -157,7 +157,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return true after the 3rd time the font is an icon',
- function() {
+ function () {
var target = queryFixture(
'delete
'
);
@@ -174,7 +174,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should return false after the 3rd time the font is not an icon',
- function() {
+ function () {
var target = queryFixture(
'__non-icon text__
'
);
@@ -189,10 +189,10 @@ describe('text.isIconLigature', function() {
}
);
- describe('pixelThreshold', function() {
+ describe('pixelThreshold', function () {
(fontApiSupport ? it : it.skip)(
'should allow higher percent (will not flag icon ligatures)',
- function() {
+ function () {
var target = queryFixture(
'delete
'
);
@@ -204,7 +204,7 @@ describe('text.isIconLigature', function() {
(fontApiSupport ? it : it.skip)(
'should allow lower percent (will flag text ligatures)',
- function() {
+ function () {
var target = queryFixture(
'figure
'
);
@@ -213,10 +213,10 @@ describe('text.isIconLigature', function() {
);
});
- describe('occuranceThreshold', function() {
+ describe('occuranceThreshold', function () {
(fontApiSupport ? it : it.skip)(
'should change the number of times a font is seen before returning',
- function() {
+ function () {
var target = queryFixture(
'delete
'
);
diff --git a/test/commons/text/is-valid-autocomplete.js b/test/commons/text/is-valid-autocomplete.js
index edf9e9b868..a36e7be15e 100644
--- a/test/commons/text/is-valid-autocomplete.js
+++ b/test/commons/text/is-valid-autocomplete.js
@@ -1,4 +1,4 @@
-describe('text.isValidAutocomplete', function() {
+describe('text.isValidAutocomplete', function () {
'use strict';
var isValidAutocomplete = axe.commons.text.isValidAutocomplete;
@@ -7,49 +7,49 @@ describe('text.isValidAutocomplete', function() {
qualifiedTerms: ['qualified-term']
};
- it('returns true if autocomplete is `on` or `off', function() {
- ['on', 'off'].forEach(function(state) {
+ it('returns true if autocomplete is `on` or `off', function () {
+ ['on', 'off'].forEach(function (state) {
assert.isTrue(isValidAutocomplete(state, options));
});
});
- it('returns false if `on` or `off` is used with another term', function() {
- ['on', 'off'].forEach(function(state) {
+ it('returns false if `on` or `off` is used with another term', function () {
+ ['on', 'off'].forEach(function (state) {
assert.isFalse(isValidAutocomplete('section-foo ' + state, options));
});
});
- it('returns true the only term is a valid autocomplete term', function() {
+ it('returns true the only term is a valid autocomplete term', function () {
assert.isTrue(isValidAutocomplete('standalone-term', options));
});
- it('returns false the only term is an invalid autocomplete term', function() {
+ it('returns false the only term is an invalid autocomplete term', function () {
assert.isFalse(isValidAutocomplete('bad-term', options));
});
- it('returns true if section-* is used as the first term', function() {
+ it('returns true if section-* is used as the first term', function () {
assert.isTrue(isValidAutocomplete('section-foo standalone-term', options));
});
- it('returns true if `shipping` or `billing` is used as the first term', function() {
+ it('returns true if `shipping` or `billing` is used as the first term', function () {
assert.isTrue(isValidAutocomplete('shipping standalone-term', options));
assert.isTrue(isValidAutocomplete('billing standalone-term', options));
});
- it('returns true if section-* is used before `shipping` or `billing`', function() {
+ it('returns true if section-* is used before `shipping` or `billing`', function () {
assert.isTrue(
isValidAutocomplete('section-foo shipping standalone-term', options)
);
});
- it('returns false if `shipping` or `billing` is used before section-*', function() {
+ it('returns false if `shipping` or `billing` is used before section-*', function () {
assert.isFalse(
isValidAutocomplete('shipping section-foo standalone-term', options)
);
});
- it('returns true if "home", "work", "mobile", "fax" or "pager" is used before a qualifier', function() {
- ['home', 'work', 'mobile', 'fax', 'pager'].forEach(function(qualifier) {
+ it('returns true if "home", "work", "mobile", "fax" or "pager" is used before a qualifier', function () {
+ ['home', 'work', 'mobile', 'fax', 'pager'].forEach(function (qualifier) {
assert.isTrue(
isValidAutocomplete(qualifier + ' qualified-term', options),
'failed for ' + qualifier
@@ -57,8 +57,8 @@ describe('text.isValidAutocomplete', function() {
});
});
- it('returns false if "home", "work", "mobile", "fax" or "pager" is used before an inappropriate term', function() {
- ['home', 'work', 'mobile', 'fax', 'pager'].forEach(function(qualifier) {
+ it('returns false if "home", "work", "mobile", "fax" or "pager" is used before an inappropriate term', function () {
+ ['home', 'work', 'mobile', 'fax', 'pager'].forEach(function (qualifier) {
assert.isFalse(
isValidAutocomplete(qualifier + ' standalone-term', options),
'failed for ' + qualifier
@@ -66,8 +66,8 @@ describe('text.isValidAutocomplete', function() {
});
});
- describe('options.strictMode:false', function() {
- it('returns true if the last term is a valid autocomplete term', function() {
+ describe('options.strictMode:false', function () {
+ it('returns true if the last term is a valid autocomplete term', function () {
assert.isTrue(
isValidAutocomplete('do not care! valid-term', {
looseTyped: true,
@@ -76,7 +76,7 @@ describe('text.isValidAutocomplete', function() {
);
});
- it('returns false if the last term is an invalid autocomplete term', function() {
+ it('returns false if the last term is an invalid autocomplete term', function () {
assert.isFalse(
isValidAutocomplete('shipping invalid', {
looseTyped: true,
diff --git a/test/commons/text/label-text.js b/test/commons/text/label-text.js
index b6ab4fd5ee..2ee27154a3 100644
--- a/test/commons/text/label-text.js
+++ b/test/commons/text/label-text.js
@@ -1,22 +1,22 @@
-describe('text.labelText', function() {
+describe('text.labelText', function () {
var labelText = axe.commons.text.labelText;
var queryFixture = axe.testUtils.queryFixture;
- it('returns the text of an implicit label', function() {
+ it('returns the text of an implicit label', function () {
var target = queryFixture(
'' + 'My implicit label ' + ' '
);
assert.equal(labelText(target), 'My implicit label');
});
- it('returns the text of an explicit label', function() {
+ it('returns the text of an explicit label', function () {
var target = queryFixture(
'My explicit label ' + ' '
);
assert.equal(labelText(target), 'My explicit label');
});
- it('ignores the text of nested implicit labels', function() {
+ it('ignores the text of nested implicit labels', function () {
var target = queryFixture(
'My outer label' +
'My inner label' +
@@ -27,7 +27,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My inner label');
});
- it('concatinates multiple explicit labels', function() {
+ it('concatinates multiple explicit labels', function () {
var target = queryFixture(
'My label 1 ' +
'My label 2 ' +
@@ -36,7 +36,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My label 1 My label 2');
});
- it('concatinates explicit and implicit labels', function() {
+ it('concatinates explicit and implicit labels', function () {
var target = queryFixture(
'My explicit label ' +
'My implicit label' +
@@ -46,7 +46,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My explicit label My implicit label');
});
- it('returns label text in the DOM order', function() {
+ it('returns label text in the DOM order', function () {
var target = queryFixture(
'Label 1 ' +
'My implicit ' +
@@ -58,7 +58,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'Label 1 My implicit Label 2 Label 3');
});
- it('does not return the same label twice', function() {
+ it('does not return the same label twice', function () {
var target = queryFixture(
'' +
'My implicit and explicit label' +
@@ -68,7 +68,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My implicit and explicit label');
});
- it('ignores the value of a textbox', function() {
+ it('ignores the value of a textbox', function () {
var target = queryFixture(
'My label' +
' ' +
@@ -77,7 +77,7 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My label');
});
- it('ignores the content of a textarea', function() {
+ it('ignores the content of a textarea', function () {
var target = queryFixture(
'My label' +
'My label' +
'' +
@@ -98,8 +98,8 @@ describe('text.labelText', function() {
assert.equal(labelText(target), 'My label');
});
- describe('with context = { inControlContext: true }', function() {
- it('returns `` ', function() {
+ describe('with context = { inControlContext: true }', function () {
+ it('returns `` ', function () {
var target = queryFixture(
'My explicit label ' +
' '
@@ -108,8 +108,8 @@ describe('text.labelText', function() {
});
});
- describe('with context = { inLabelledByContext: true }', function() {
- it('returns `` ', function() {
+ describe('with context = { inLabelledByContext: true }', function () {
+ it('returns `` ', function () {
var target = queryFixture(
'My explicit label ' +
' '
diff --git a/test/commons/text/label-virtual.js b/test/commons/text/label-virtual.js
index 7e9f2e5722..f7b3ec814a 100644
--- a/test/commons/text/label-virtual.js
+++ b/test/commons/text/label-virtual.js
@@ -1,12 +1,12 @@
-describe('text.labelVirtual', function() {
+describe('text.labelVirtual', function () {
'use strict';
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('is called from text.label', function() {
+ it('is called from text.label', function () {
fixture.innerHTML =
'monkeys
bananas
' +
' ';
@@ -16,8 +16,8 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.label(target), 'monkeys bananas');
});
- describe('aria-labelledby', function() {
- it('should join text with a single space', function() {
+ describe('aria-labelledby', function () {
+ it('should join text with a single space', function () {
fixture.innerHTML =
'monkeys
bananas
' +
' ';
@@ -27,7 +27,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys bananas');
});
- it('should filter invisible elements', function() {
+ it('should filter invisible elements', function () {
fixture.innerHTML =
'monkeys
bananas
' +
' ';
@@ -37,7 +37,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys');
});
- it('should take precedence over aria-label', function() {
+ it('should take precedence over aria-label', function () {
fixture.innerHTML =
'monkeys
bananas
' +
' ';
@@ -47,7 +47,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys bananas');
});
- it('should take precedence over explicit labels', function() {
+ it('should take precedence over explicit labels', function () {
fixture.innerHTML =
'monkeys
bananas
' +
'nope ' +
@@ -58,7 +58,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys bananas');
});
- it('should take precedence over implicit labels', function() {
+ it('should take precedence over implicit labels', function () {
fixture.innerHTML =
'monkeys
bananas
' +
'nope' +
@@ -69,7 +69,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys bananas');
});
- it('should ignore whitespace only labels', function() {
+ it('should ignore whitespace only labels', function () {
fixture.innerHTML =
' \n
' +
' ';
@@ -80,8 +80,8 @@ describe('text.labelVirtual', function() {
});
});
- describe('aria-label', function() {
- it('should detect it', function() {
+ describe('aria-label', function () {
+ it('should detect it', function () {
fixture.innerHTML = ' ';
var tree = axe.testUtils.flatTreeSetup(document.body);
@@ -89,7 +89,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys');
});
- it('should ignore whitespace only labels', function() {
+ it('should ignore whitespace only labels', function () {
fixture.innerHTML = ' ';
var tree = axe.testUtils.flatTreeSetup(document.body);
@@ -97,7 +97,7 @@ describe('text.labelVirtual', function() {
assert.isNull(axe.commons.text.labelVirtual(target));
});
- it('should take precedence over explicit labels', function() {
+ it('should take precedence over explicit labels', function () {
fixture.innerHTML =
'nope ' +
' ';
@@ -107,7 +107,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys');
});
- it('should take precedence over implicit labels', function() {
+ it('should take precedence over implicit labels', function () {
fixture.innerHTML =
'nope' + ' ';
@@ -117,8 +117,8 @@ describe('text.labelVirtual', function() {
});
});
- describe('explicit label', function() {
- it('should detect it', function() {
+ describe('explicit label', function () {
+ it('should detect it', function () {
fixture.innerHTML =
'monkeys ' + ' ';
@@ -127,7 +127,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys');
});
- it('should ignore whitespace only or empty labels', function() {
+ it('should ignore whitespace only or empty labels', function () {
fixture.innerHTML =
' \n\r ' + ' ';
@@ -136,7 +136,7 @@ describe('text.labelVirtual', function() {
assert.isNull(axe.commons.text.labelVirtual(target));
});
- it('should take precedence over implicit labels', function() {
+ it('should take precedence over implicit labels', function () {
fixture.innerHTML =
'monkeys ' +
'nope' +
@@ -148,8 +148,8 @@ describe('text.labelVirtual', function() {
});
});
- describe('implicit label', function() {
- it('should detect it', function() {
+ describe('implicit label', function () {
+ it('should detect it', function () {
fixture.innerHTML = 'monkeys' + '';
var tree = axe.testUtils.flatTreeSetup(document.body);
@@ -157,7 +157,7 @@ describe('text.labelVirtual', function() {
assert.equal(axe.commons.text.labelVirtual(target), 'monkeys');
});
- it('should ignore whitespace only or empty labels', function() {
+ it('should ignore whitespace only or empty labels', function () {
fixture.innerHTML = ' ' + '';
var tree = axe.testUtils.flatTreeSetup(document.body);
diff --git a/test/commons/text/native-text-methods.js b/test/commons/text/native-text-methods.js
index 195e07df80..df1cf5be8e 100644
--- a/test/commons/text/native-text-methods.js
+++ b/test/commons/text/native-text-methods.js
@@ -1,26 +1,26 @@
-describe('text.nativeTextMethods', function() {
+describe('text.nativeTextMethods', function () {
var text = axe.commons.text;
var nativeTextMethods = text.nativeTextMethods;
var fixtureSetup = axe.testUtils.fixtureSetup;
- describe('valueText', function() {
+ describe('valueText', function () {
var valueText = nativeTextMethods.valueText;
- it('returns the value of actualNode', function() {
+ it('returns the value of actualNode', function () {
fixtureSetup(' ');
var input = axe.utils.querySelectorAll(axe._tree[0], 'input')[0];
assert.equal(valueText(input), 'foo');
});
- it('returns `` when there is no value', function() {
+ it('returns `` when there is no value', function () {
fixtureSetup(' ');
var input = axe.utils.querySelectorAll(axe._tree[0], 'input')[0];
assert.equal(valueText(input), '');
});
});
- describe('buttonDefaultText', function() {
+ describe('buttonDefaultText', function () {
var buttonDefaultText = nativeTextMethods.buttonDefaultText;
- it('returns the default button text', function() {
+ it('returns the default button text', function () {
fixtureSetup(
' ' +
' ' +
@@ -34,31 +34,31 @@ describe('text.nativeTextMethods', function() {
assert.equal(buttonDefaultText(inputs[3]), '');
});
- it('returns `` when the element is not a button', function() {
+ it('returns `` when the element is not a button', function () {
fixtureSetup(' ');
var input = axe.utils.querySelectorAll(axe._tree[0], 'input')[0];
assert.equal(buttonDefaultText(input), '');
});
});
- describe('altText', function() {
+ describe('altText', function () {
var altText = nativeTextMethods.altText;
- it('returns the alt attribute of actualNode', function() {
+ it('returns the alt attribute of actualNode', function () {
fixtureSetup(' ');
var img = axe.utils.querySelectorAll(axe._tree[0], 'img')[0];
assert.equal(altText(img), 'foo');
});
- it('returns `` when there is no alt', function() {
+ it('returns `` when there is no alt', function () {
fixtureSetup(' ');
var img = axe.utils.querySelectorAll(axe._tree[0], 'img')[0];
assert.equal(altText(img), '');
});
});
- describe('figureText', function() {
+ describe('figureText', function () {
var figureText = nativeTextMethods.figureText;
- it('returns the figcaption text', function() {
+ it('returns the figcaption text', function () {
fixtureSetup(
'' +
' My caption ' +
@@ -69,18 +69,18 @@ describe('text.nativeTextMethods', function() {
assert.equal(figureText(figure), 'My caption');
});
- it('returns `` when there is no figcaption', function() {
+ it('returns `` when there is no figcaption', function () {
var figureText = nativeTextMethods.figureText;
- it('returns the figcaption text', function() {
+ it('returns the figcaption text', function () {
fixtureSetup('' + ' some content' + ' ');
var figure = axe.utils.querySelectorAll(axe._tree[0], 'figure')[0];
assert.equal(figureText(figure), '');
});
});
- it('returns `` when if the figcaption is nested in another figure', function() {
+ it('returns `` when if the figcaption is nested in another figure', function () {
var figureText = nativeTextMethods.figureText;
- it('returns the figcaption text', function() {
+ it('returns the figcaption text', function () {
fixtureSetup(
'' +
' ' +
@@ -96,9 +96,9 @@ describe('text.nativeTextMethods', function() {
});
});
- describe('tableCaptionText', function() {
+ describe('tableCaptionText', function () {
var tableCaptionText = nativeTextMethods.tableCaptionText;
- it('returns the table caption text', function() {
+ it('returns the table caption text', function () {
fixtureSetup(
'' +
' My caption ' +
@@ -110,7 +110,7 @@ describe('text.nativeTextMethods', function() {
assert.equal(tableCaptionText(table), 'My caption');
});
- it('returns `` when there is no caption', function() {
+ it('returns `` when there is no caption', function () {
fixtureSetup(
'' +
' heading ' +
@@ -121,7 +121,7 @@ describe('text.nativeTextMethods', function() {
assert.equal(tableCaptionText(table), '');
});
- it('returns `` when if the caption is nested in another table', function() {
+ it('returns `` when if the caption is nested in another table', function () {
fixtureSetup(
'' +
' ' +
@@ -138,9 +138,9 @@ describe('text.nativeTextMethods', function() {
});
});
- describe('fieldsetLegendText', function() {
+ describe('fieldsetLegendText', function () {
var fieldsetLegendText = nativeTextMethods.fieldsetLegendText;
- it('returns the legend text', function() {
+ it('returns the legend text', function () {
fixtureSetup(
'' +
' My legend ' +
@@ -151,18 +151,18 @@ describe('text.nativeTextMethods', function() {
assert.equal(fieldsetLegendText(fieldset), 'My legend');
});
- it('returns `` when there is no legend', function() {
+ it('returns `` when there is no legend', function () {
var fieldsetLegendText = nativeTextMethods.fieldsetLegendText;
- it('returns the legend text', function() {
+ it('returns the legend text', function () {
fixtureSetup('' + ' some content' + ' ');
var fieldset = axe.utils.querySelectorAll(axe._tree[0], 'fieldset')[0];
assert.equal(fieldsetLegendText(fieldset), '');
});
});
- it('returns `` when if the legend is nested in another fieldset', function() {
+ it('returns `` when if the legend is nested in another fieldset', function () {
var fieldsetLegendText = nativeTextMethods.fieldsetLegendText;
- it('returns the legend text', function() {
+ it('returns the legend text', function () {
fixtureSetup(
'' +
' ' +
@@ -178,9 +178,9 @@ describe('text.nativeTextMethods', function() {
});
});
- describe('svgTitleText', function() {
+ describe('svgTitleText', function () {
var svgTitleText = nativeTextMethods.svgTitleText;
- it('returns the title text', function() {
+ it('returns the title text', function () {
fixtureSetup(
'' + ' My title ' + ' some content' + ' '
);
@@ -188,16 +188,16 @@ describe('text.nativeTextMethods', function() {
assert.equal(svgTitleText(svg), 'My title');
});
- it('returns `` when there is no title', function() {
- it('returns the title text', function() {
+ it('returns `` when there is no title', function () {
+ it('returns the title text', function () {
fixtureSetup('' + ' some content' + ' ');
var svg = axe.utils.querySelectorAll(axe._tree[0], 'svg')[0];
assert.equal(svgTitleText(svg), '');
});
});
- it('returns `` when if the title is nested in another svg', function() {
- it('returns the title text', function() {
+ it('returns `` when if the title is nested in another svg', function () {
+ it('returns the title text', function () {
fixtureSetup(
'' +
' ' +
@@ -213,22 +213,22 @@ describe('text.nativeTextMethods', function() {
});
});
- describe('singleSpace', function() {
+ describe('singleSpace', function () {
var singleSpace = nativeTextMethods.singleSpace;
- it('returns a single space', function() {
+ it('returns a single space', function () {
assert.equal(singleSpace(), ' ');
});
});
- describe('placeholderText', function() {
+ describe('placeholderText', function () {
var placeholderText = nativeTextMethods.placeholderText;
- it('returns the placeholder attribute of actualNode', function() {
+ it('returns the placeholder attribute of actualNode', function () {
fixtureSetup(' ');
var input = axe.utils.querySelectorAll(axe._tree[0], 'input')[0];
assert.equal(placeholderText(input), 'foo');
});
- it('returns `` when there is no placeholder', function() {
+ it('returns `` when there is no placeholder', function () {
fixtureSetup(' ');
var input = axe.utils.querySelectorAll(axe._tree[0], 'input')[0];
assert.equal(placeholderText(input), '');
diff --git a/test/commons/text/sanitize.js b/test/commons/text/sanitize.js
index e483329791..91b66cafd3 100644
--- a/test/commons/text/sanitize.js
+++ b/test/commons/text/sanitize.js
@@ -1,7 +1,7 @@
-describe('text.sanitize', function() {
+describe('text.sanitize', function () {
'use strict';
- it('should collapse whitespace and trim', function() {
+ it('should collapse whitespace and trim', function () {
assert.equal(axe.commons.text.sanitize('\thi\t'), 'hi');
assert.equal(axe.commons.text.sanitize('\t\nhi \t'), 'hi');
assert.equal(axe.commons.text.sanitize('\thi \n\t '), 'hi');
@@ -9,7 +9,7 @@ describe('text.sanitize', function() {
assert.equal(axe.commons.text.sanitize('hello\u00A0there'), 'hello there');
});
- it('should accept null', function() {
+ it('should accept null', function () {
assert.equal(axe.commons.text.sanitize(null), '');
});
});
diff --git a/test/commons/text/subtree-text.js b/test/commons/text/subtree-text.js
index 143ad71d63..a38d05e4bd 100644
--- a/test/commons/text/subtree-text.js
+++ b/test/commons/text/subtree-text.js
@@ -1,20 +1,20 @@
-describe('text.subtreeText', function() {
+describe('text.subtreeText', function () {
var fixtureSetup = axe.testUtils.fixtureSetup;
var subtreeText = axe.commons.text.subtreeText;
- it('concatinated the accessible name for child elements', function() {
+ it('concatinated the accessible name for child elements', function () {
fixtureSetup('foo bar baz ');
var fixture = axe.utils.querySelectorAll(axe._tree[0], '#fixture')[0];
assert.equal(subtreeText(fixture), 'foo bar baz');
});
- it('returns `` when the element is not named from contents', function() {
+ it('returns `` when the element is not named from contents', function () {
fixtureSetup('foo bar baz ');
var main = axe.utils.querySelectorAll(axe._tree[0], 'main')[0];
assert.equal(subtreeText(main), '');
});
- it('adds spacing around "block-like" elements', function() {
+ it('adds spacing around "block-like" elements', function () {
fixtureSetup(
'foo
' +
'bar ' +
@@ -26,7 +26,7 @@ describe('text.subtreeText', function() {
assert.equal(subtreeText(fixture), 'foo bar baz fizz buzz ');
});
- it('does not add spacing around "inline-like" elements', function() {
+ it('does not add spacing around "inline-like" elements', function () {
fixtureSetup(
'foo ' + 'bar ' + 'baz ' + 'fizz ' + 'buzz '
);
@@ -34,13 +34,13 @@ describe('text.subtreeText', function() {
assert.equal(subtreeText(fixture), 'foobarbazfizzbuzz');
});
- it('returns `` for embedded content', function() {
+ it('returns `` for embedded content', function () {
fixtureSetup(
'foo ' +
- 'foo ' +
- 'foo ' +
- '' +
- 'foo '
+ 'foo ' +
+ 'foo ' +
+ '' +
+ 'foo '
);
var children = axe._tree[0].children;
assert.lengthOf(children, 5);
@@ -49,12 +49,12 @@ describe('text.subtreeText', function() {
});
});
- describe('context.processed', function() {
- beforeEach(function() {
+ describe('context.processed', function () {
+ beforeEach(function () {
fixtureSetup('foo ');
});
- it('appends the element to context.processed to prevent duplication', function() {
+ it('appends the element to context.processed to prevent duplication', function () {
var h1 = axe.utils.querySelectorAll(axe._tree[0], 'h1')[0];
var text = h1.children[0];
var context = { processed: [] };
@@ -62,7 +62,7 @@ describe('text.subtreeText', function() {
assert.deepEqual(context.processed, [h1, text]);
});
- it('sets context.processed when it is undefined', function() {
+ it('sets context.processed when it is undefined', function () {
var h1 = axe.utils.querySelectorAll(axe._tree[0], 'h1')[0];
var text = h1.children[0];
var emptyContext = {};
@@ -70,7 +70,7 @@ describe('text.subtreeText', function() {
assert.deepEqual(emptyContext.processed, [h1, text]);
});
- it('returns `` when the element is in the `processed` array', function() {
+ it('returns `` when the element is in the `processed` array', function () {
var h1 = axe.utils.querySelectorAll(axe._tree[0], 'h1')[0];
var context = {
processed: [h1]
diff --git a/test/commons/text/unicode.js b/test/commons/text/unicode.js
index 8a910e0ea3..b5d8b2489e 100644
--- a/test/commons/text/unicode.js
+++ b/test/commons/text/unicode.js
@@ -1,76 +1,76 @@
-describe('text.hasUnicode', function() {
- describe('text.hasUnicode, characters of type Non Bi Multilingual Plane', function() {
- it('returns false when given string is alphanumeric', function() {
+describe('text.hasUnicode', function () {
+ describe('text.hasUnicode, characters of type Non Bi Multilingual Plane', function () {
+ it('returns false when given string is alphanumeric', function () {
var actual = axe.commons.text.hasUnicode('1 apple', {
nonBmp: true
});
assert.isFalse(actual);
});
- it('returns false when given string is number', function() {
+ it('returns false when given string is number', function () {
var actual = axe.commons.text.hasUnicode('100', {
nonBmp: true
});
assert.isFalse(actual);
});
- it('returns false when given string is a sentence', function() {
+ it('returns false when given string is a sentence', function () {
var actual = axe.commons.text.hasUnicode('Earth is round', {
nonBmp: true
});
assert.isFalse(actual);
});
- it('returns true when given string is a phonetic extension', function() {
+ it('returns true when given string is a phonetic extension', function () {
var actual = axe.commons.text.hasUnicode('ᴁ', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string is a combining diacritical marks supplement', function() {
+ it('returns true when given string is a combining diacritical marks supplement', function () {
var actual = axe.commons.text.hasUnicode('ᴁ', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string is a currency symbols', function() {
+ it('returns true when given string is a currency symbols', function () {
var actual = axe.commons.text.hasUnicode('₨ 20000', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string has arrows', function() {
+ it('returns true when given string has arrows', function () {
var actual = axe.commons.text.hasUnicode('← turn left', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string has geometric shapes', function() {
+ it('returns true when given string has geometric shapes', function () {
var actual = axe.commons.text.hasUnicode('◓', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string has math operators', function() {
+ it('returns true when given string has math operators', function () {
var actual = axe.commons.text.hasUnicode('√4 = 2', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true when given string has windings font', function() {
+ it('returns true when given string has windings font', function () {
var actual = axe.commons.text.hasUnicode('▽', {
nonBmp: true
});
assert.isTrue(actual);
});
- it('returns true for a string with characters in supplementary private use area A', function() {
+ it('returns true for a string with characters in supplementary private use area A', function () {
var actual = axe.commons.text.hasUnicode('\uDB80\uDFFE', {
nonBmp: true
});
@@ -78,8 +78,8 @@ describe('text.hasUnicode', function() {
});
});
- describe('text.hasUnicode, characters of type Emoji', function() {
- it('returns false when given string is alphanumeric', function() {
+ describe('text.hasUnicode, characters of type Emoji', function () {
+ it('returns false when given string is alphanumeric', function () {
var actual = axe.commons.text.hasUnicode(
'1 apple a day, keeps the doctor away',
{
@@ -89,28 +89,28 @@ describe('text.hasUnicode', function() {
assert.isFalse(actual);
});
- it('returns false when given string is number', function() {
+ it('returns false when given string is number', function () {
var actual = axe.commons.text.hasUnicode('100', {
emoji: true
});
assert.isFalse(actual);
});
- it('returns false when given string is a sentence', function() {
+ it('returns false when given string is a sentence', function () {
var actual = axe.commons.text.hasUnicode('Earth is round', {
emoji: true
});
assert.isFalse(actual);
});
- it('returns true when given string has emoji', function() {
+ it('returns true when given string has emoji', function () {
var actual = axe.commons.text.hasUnicode('🌎 is round', {
emoji: true
});
assert.isTrue(actual);
});
- it('returns true when given string has emoji', function() {
+ it('returns true when given string has emoji', function () {
var actual = axe.commons.text.hasUnicode('plant a 🌱', {
emoji: true
});
@@ -118,30 +118,30 @@ describe('text.hasUnicode', function() {
});
});
- describe('text.hasUnicode, characters of type punctuations', function() {
- it('returns false when given string is number', function() {
+ describe('text.hasUnicode, characters of type punctuations', function () {
+ it('returns false when given string is number', function () {
var actual = axe.commons.text.hasUnicode('100', {
punctuations: true
});
assert.isFalse(actual);
});
- it('returns false when given string is a sentence', function() {
+ it('returns false when given string is a sentence', function () {
var actual = axe.commons.text.hasUnicode('Earth is round', {
punctuations: true
});
assert.isFalse(actual);
});
- it('returns true when given string has punctuations', function() {
+ it('returns true when given string has punctuations', function () {
var actual = axe.commons.text.hasUnicode("What's your name?", {
punctuations: true
});
assert.isTrue(actual);
});
- it('returns true for strings with money signs and odd symbols', function() {
- ['£', '¢', '¥', '€', '§', '±'].forEach(function(str) {
+ it('returns true for strings with money signs and odd symbols', function () {
+ ['£', '¢', '¥', '€', '§', '±'].forEach(function (str) {
var actual = axe.commons.text.hasUnicode(str, {
punctuations: true
});
@@ -150,8 +150,8 @@ describe('text.hasUnicode', function() {
});
});
- describe('text.hasUnicode, has combination of unicode', function() {
- it('returns false when given string is number', function() {
+ describe('text.hasUnicode, has combination of unicode', function () {
+ it('returns false when given string is number', function () {
var actual = axe.commons.text.hasUnicode('100', {
emoji: true,
nonBmp: true,
@@ -160,7 +160,7 @@ describe('text.hasUnicode', function() {
assert.isFalse(actual);
});
- it('returns true when given string has unicode characters', function() {
+ it('returns true when given string has unicode characters', function () {
var actual = axe.commons.text.hasUnicode(
'The ☀️ is orange, the ◓ is white.',
{
@@ -174,57 +174,57 @@ describe('text.hasUnicode', function() {
});
});
-describe('text.removeUnicode', function() {
- it('returns string by removing non BMP unicode ', function() {
+describe('text.removeUnicode', function () {
+ it('returns string by removing non BMP unicode ', function () {
var actual = axe.commons.text.removeUnicode('₨₨20000₨₨', {
nonBmp: true
});
assert.equal(actual, '20000');
});
- it('returns string by removing emoji unicode ', function() {
+ it('returns string by removing emoji unicode ', function () {
var actual = axe.commons.text.removeUnicode('☀️Sun 🌎Earth', {
emoji: true
});
assert.equal(actual, 'Sun Earth');
});
- it('returns string after removing punctuations from word', function() {
+ it('returns string after removing punctuations from word', function () {
var actual = axe.commons.text.removeUnicode('Earth!!!', {
punctuations: true
});
assert.equal(actual, 'Earth');
});
- it('returns string removing all punctuations', function() {
+ it('returns string removing all punctuations', function () {
var actual = axe.commons.text.removeUnicode('', {
punctuations: true
});
assert.equal(actual, '');
});
- it('returns string removing all private use unicode', function() {
+ it('returns string removing all private use unicode', function () {
var actual = axe.commons.text.removeUnicode('', {
nonBmp: true
});
assert.equal(actual, '');
});
- it('returns string removing all supplementary private use unicode', function() {
+ it('returns string removing all supplementary private use unicode', function () {
var actual = axe.commons.text.removeUnicode('', {
nonBmp: true
});
assert.equal(actual, '');
});
- it('returns the string with supplementary private use area A characters removed', function() {
+ it('returns the string with supplementary private use area A characters removed', function () {
var actual = axe.commons.text.removeUnicode('\uDB80\uDFFE', {
nonBmp: true
});
assert.equal(actual, '');
});
- it('returns string removing combination of unicode characters', function() {
+ it('returns string removing combination of unicode characters', function () {
var actual = axe.commons.text.removeUnicode(
'The ☀️ is orange, the ◓ is white.',
{
diff --git a/test/commons/text/visible-text-nodes.js b/test/commons/text/visible-text-nodes.js
index 4a1914a1d0..3d8b46b866 100644
--- a/test/commons/text/visible-text-nodes.js
+++ b/test/commons/text/visible-text-nodes.js
@@ -1,4 +1,4 @@
-describe('text.visibleTextNodes', function() {
+describe('text.visibleTextNodes', function () {
'use strict';
var fixture = document.getElementById('fixture');
@@ -6,11 +6,11 @@ describe('text.visibleTextNodes', function() {
var shadowSupported = axe.testUtils.shadowSupport.v1;
var visibleTextNodes = axe.commons.text.visibleTextNodes;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should handle multiple text nodes to a single parent', function() {
+ it('should handle multiple text nodes to a single parent', function () {
var vNode = queryFixture(
'HelloHi Goodbye
'
);
@@ -21,7 +21,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[2].actualNode.nodeValue, 'Goodbye');
});
- it('should handle recursive calls', function() {
+ it('should handle recursive calls', function () {
var vNode = queryFixture(
'HelloHi
'
);
@@ -31,7 +31,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[1].actualNode.nodeValue, 'Hi');
});
- it('should not return elements with visibility: hidden', function() {
+ it('should not return elements with visibility: hidden', function () {
var vNode = queryFixture(
'HelloHi
'
);
@@ -40,7 +40,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[0].actualNode.nodeValue, 'Hello');
});
- it('should know how visibility works', function() {
+ it('should know how visibility works', function () {
var vNode = queryFixture(
'Hello
' +
'Hi ' +
@@ -52,7 +52,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[1].actualNode.nodeValue, 'Hi');
});
- it('should not return elements with display: none', function() {
+ it('should not return elements with display: none', function () {
var vNode = queryFixture(
'HelloHi
'
);
@@ -61,7 +61,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[0].actualNode.nodeValue, 'Hello');
});
- it('should ignore script and style tags', function() {
+ it('should ignore script and style tags', function () {
var vNode = queryFixture(
'' +
'Hello
'
@@ -71,7 +71,7 @@ describe('text.visibleTextNodes', function() {
assert.equal(nodes[0].actualNode.nodeValue, 'Hello');
});
- it('should not take into account position of parents', function() {
+ it('should not take into account position of parents', function () {
var vNode = queryFixture(
'' +
'
' +
@@ -86,7 +86,7 @@ describe('text.visibleTextNodes', function() {
(shadowSupported ? it : xit)(
'should correctly handle slotted elements',
- function() {
+ function () {
function createContentSlotted() {
var group = document.createElement('div');
group.innerHTML = '
Stuff
';
diff --git a/test/commons/text/visible-virtual.js b/test/commons/text/visible-virtual.js
index 848d896426..61797cf288 100644
--- a/test/commons/text/visible-virtual.js
+++ b/test/commons/text/visible-virtual.js
@@ -1,40 +1,40 @@
-describe('text.visible', function() {
+describe('text.visible', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowSupported = axe.testUtils.shadowSupport.v1;
var visibleVirtual = axe.commons.text.visibleVirtual;
- afterEach(function() {
+ afterEach(function () {
document.getElementById('fixture').innerHTML = '';
});
- describe('non-screen-reader', function() {
- it('should not return elements with visibility: hidden', function() {
+ describe('non-screen-reader', function () {
+ it('should not return elements with visibility: hidden', function () {
fixture.innerHTML = 'Hello
Hi ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0]), 'Hello');
});
- it('should handle implicitly recursive calls', function() {
+ it('should handle implicitly recursive calls', function () {
fixture.innerHTML = 'Hello
Hi ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0]), 'HelloHi');
});
- it('should handle explicitly recursive calls', function() {
+ it('should handle explicitly recursive calls', function () {
fixture.innerHTML = 'Hello
Hi ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0], null, false), 'HelloHi');
});
- it('should handle non-recursive calls', function() {
+ it('should handle non-recursive calls', function () {
fixture.innerHTML = 'Hello
Hi ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0], null, true), 'Hello');
});
- it('should know how visibility works', function() {
+ it('should know how visibility works', function () {
fixture.innerHTML =
'Hello
' +
'Hi ' +
@@ -44,7 +44,7 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0]), 'Hello Hi');
});
- it('should not return elements with display: none', function() {
+ it('should not return elements with display: none', function () {
fixture.innerHTML =
'HelloHi ';
@@ -52,14 +52,14 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0]), 'Hello');
});
- it('should trim the result', function() {
+ it('should trim the result', function () {
fixture.innerHTML =
' \u00A0 Hello \r\n Hi \n \n \n ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0]), 'Hello Hi');
});
- it('should ignore script and style tags', function() {
+ it('should ignore script and style tags', function () {
fixture.innerHTML =
'' + 'Hello';
@@ -67,7 +67,7 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0]), 'Hello');
});
- it('should not take into account position of parents', function() {
+ it('should not take into account position of parents', function () {
fixture.innerHTML =
'' +
'
Hello
' +
@@ -79,7 +79,7 @@ describe('text.visible', function() {
(shadowSupported ? it : xit)(
'should correctly handle slotted elements',
- function() {
+ function () {
function createContentSlotted() {
var group = document.createElement('div');
group.innerHTML = '
Stuff
';
@@ -99,15 +99,15 @@ describe('text.visible', function() {
);
});
- describe('screen reader', function() {
- it('should not return elements with visibility: hidden', function() {
+ describe('screen reader', function () {
+ it('should not return elements with visibility: hidden', function () {
fixture.innerHTML = 'Hello
Hi ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0], true), 'Hello');
});
- it('should know how visibility works', function() {
+ it('should know how visibility works', function () {
fixture.innerHTML =
'Hello
' +
'Hi ' +
@@ -117,7 +117,7 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0], true), 'Hello Hi');
});
- it('should not return elements with display: none', function() {
+ it('should not return elements with display: none', function () {
fixture.innerHTML =
'HelloHi ';
@@ -125,14 +125,14 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0], true), 'Hello');
});
- it('should trim the result', function() {
+ it('should trim the result', function () {
fixture.innerHTML =
' \u00A0 Hello \r\n Hi \n \n \n ';
var tree = axe.utils.getFlattenedTree(fixture);
assert.equal(visibleVirtual(tree[0], true), 'Hello Hi');
});
- it('should ignore script and style tags', function() {
+ it('should ignore script and style tags', function () {
fixture.innerHTML =
'' + 'Hello';
@@ -140,7 +140,7 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0], true), 'Hello');
});
- it('should not consider offscreen text as hidden (position)', function() {
+ it('should not consider offscreen text as hidden (position)', function () {
fixture.innerHTML =
'' +
'
Hello
' +
@@ -150,7 +150,7 @@ describe('text.visible', function() {
assert.equal(visibleVirtual(tree[0], true), 'Hello');
});
- it('should not consider offscreen text as hidden (text-indent)', function() {
+ it('should not consider offscreen text as hidden (text-indent)', function () {
fixture.innerHTML = '
' + 'Hello
';
var tree = axe.utils.getFlattenedTree(fixture);
diff --git a/test/commons/utils/index.js b/test/commons/utils/index.js
index e14788abd5..1c88d05c79 100644
--- a/test/commons/utils/index.js
+++ b/test/commons/utils/index.js
@@ -1,21 +1,21 @@
-describe('utils.escapeSelector', function() {
+describe('utils.escapeSelector', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.commons.utils.escapeSelector);
});
});
-describe('utils.matchesSelector', function() {
+describe('utils.matchesSelector', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.commons.utils.matchesSelector);
});
});
-describe('utils.clone', function() {
+describe('utils.clone', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.commons.utils.clone);
});
});
diff --git a/test/core/base/audit.js b/test/core/base/audit.js
index 9265f45826..7a9dfd5d77 100644
--- a/test/core/base/audit.js
+++ b/test/core/base/audit.js
@@ -1,38 +1,38 @@
/* global Promise */
-describe('Audit', function() {
+describe('Audit', function () {
'use strict';
var Audit = axe._thisWillBeDeletedDoNotUse.base.Audit;
var Rule = axe._thisWillBeDeletedDoNotUse.base.Rule;
var ver = axe.version.substring(0, axe.version.lastIndexOf('.'));
var a, getFlattenedTree;
- var isNotCalled = function(err) {
+ var isNotCalled = function (err) {
throw err || new Error('Reject should not be called');
};
- var noop = function() {};
+ var noop = function () {};
var mockChecks = [
{
id: 'positive1-check1',
- evaluate: function() {
+ evaluate: function () {
return true;
}
},
{
id: 'positive2-check1',
- evaluate: function() {
+ evaluate: function () {
return true;
}
},
{
id: 'negative1-check1',
- evaluate: function() {
+ evaluate: function () {
return true;
}
},
{
id: 'positive3-check1',
- evaluate: function() {
+ evaluate: function () {
return true;
}
}
@@ -74,42 +74,42 @@ describe('Audit', function() {
var origAuditRun;
var origAxeUtilsPreload;
- beforeEach(function() {
+ beforeEach(function () {
a = new Audit();
- mockRules.forEach(function(r) {
+ mockRules.forEach(function (r) {
a.addRule(r);
});
- mockChecks.forEach(function(c) {
+ mockChecks.forEach(function (c) {
a.addCheck(c);
});
origAuditRun = a.run;
});
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe._tree = undefined;
axe._selectCache = undefined;
a.run = origAuditRun;
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(Audit);
});
- describe('defaults', function() {
- it('should set noHtml', function() {
+ describe('defaults', function () {
+ it('should set noHtml', function () {
var audit = new Audit();
assert.isFalse(audit.noHtml);
});
- it('should set allowedOrigins', function() {
+ it('should set allowedOrigins', function () {
var audit = new Audit();
assert.deepEqual(audit.allowedOrigins, [window.location.origin]);
});
});
- describe('Audit#_constructHelpUrls', function() {
- it('should create default help URLS', function() {
+ describe('Audit#_constructHelpUrls', function () {
+ it('should create default help URLS', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -126,7 +126,7 @@ describe('Audit', function() {
'/target?application=axeAPI'
});
});
- it('should use changed branding', function() {
+ it('should use changed branding', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -144,7 +144,7 @@ describe('Audit', function() {
'/target?application=axeAPI'
});
});
- it('should use changed application', function() {
+ it('should use changed application', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -163,7 +163,7 @@ describe('Audit', function() {
});
});
- it('does not override helpUrls of different products', function() {
+ it('does not override helpUrls of different products', function () {
var audit = new Audit();
audit.addRule({
id: 'target1',
@@ -207,7 +207,7 @@ describe('Audit', function() {
'/target2?application=axeAPI'
);
});
- it('understands prerelease type version numbers', function() {
+ it('understands prerelease type version numbers', function () {
var tempVersion = axe.version;
var audit = new Audit();
audit.addRule({
@@ -226,7 +226,7 @@ describe('Audit', function() {
);
});
- it('matches major release versions', function() {
+ it('matches major release versions', function () {
var tempVersion = axe.version;
var audit = new Audit();
audit.addRule({
@@ -244,7 +244,7 @@ describe('Audit', function() {
'https://dequeuniversity.com/rules/axe/1.0/target?application=axeAPI'
);
});
- it('sets the lang query if locale has been set', function() {
+ it('sets the lang query if locale has been set', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -266,8 +266,8 @@ describe('Audit', function() {
});
});
- describe('Audit#setBranding', function() {
- it('should change the brand', function() {
+ describe('Audit#setBranding', function () {
+ it('should change the brand', function () {
var audit = new Audit();
assert.equal(audit.brand, 'axe');
assert.equal(audit.application, 'axeAPI');
@@ -277,7 +277,7 @@ describe('Audit', function() {
assert.equal(audit.brand, 'thing');
assert.equal(audit.application, 'axeAPI');
});
- it('should change the application', function() {
+ it('should change the application', function () {
var audit = new Audit();
assert.equal(audit.brand, 'axe');
assert.equal(audit.application, 'axeAPI');
@@ -287,7 +287,7 @@ describe('Audit', function() {
assert.equal(audit.brand, 'axe');
assert.equal(audit.application, 'thing');
});
- it('should change the application when passed a string', function() {
+ it('should change the application when passed a string', function () {
var audit = new Audit();
assert.equal(audit.brand, 'axe');
assert.equal(audit.application, 'axeAPI');
@@ -295,7 +295,7 @@ describe('Audit', function() {
assert.equal(audit.brand, 'axe');
assert.equal(audit.application, 'thing');
});
- it('should call _constructHelpUrls', function() {
+ it('should call _constructHelpUrls', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -314,7 +314,7 @@ describe('Audit', function() {
'/target?application=thing'
});
});
- it('should call _constructHelpUrls even when nothing changed', function() {
+ it('should call _constructHelpUrls even when nothing changed', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -331,7 +331,7 @@ describe('Audit', function() {
'/target?application=axeAPI'
});
});
- it('should not replace custom set branding', function() {
+ it('should not replace custom set branding', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -357,8 +357,8 @@ describe('Audit', function() {
});
});
- describe('Audit#addRule', function() {
- it('should override existing rule', function() {
+ describe('Audit#addRule', function () {
+ it('should override existing rule', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -378,7 +378,7 @@ describe('Audit', function() {
assert.equal(audit.rules[0].selector, 'fred');
assert.equal(audit.rules[0].matches(), 'hello');
});
- it('should otherwise push new rule', function() {
+ it('should otherwise push new rule', function () {
var audit = new Audit();
audit.addRule({
id: 'target',
@@ -399,8 +399,8 @@ describe('Audit', function() {
});
});
- describe('Audit#resetRulesAndChecks', function() {
- it('should override newly created check', function() {
+ describe('Audit#resetRulesAndChecks', function () {
+ it('should override newly created check', function () {
var audit = new Audit();
assert.equal(audit.checks.target, undefined);
audit.addCheck({
@@ -412,7 +412,7 @@ describe('Audit', function() {
audit.resetRulesAndChecks();
assert.equal(audit.checks.target, undefined);
});
- it('should reset locale', function() {
+ it('should reset locale', function () {
var audit = new Audit();
assert.equal(audit.lang, 'en');
audit.applyLocale({
@@ -422,7 +422,7 @@ describe('Audit', function() {
audit.resetRulesAndChecks();
assert.equal(audit.lang, 'en');
});
- it('should reset brand', function() {
+ it('should reset brand', function () {
var audit = new Audit();
assert.equal(audit.brand, 'axe');
audit.setBranding({
@@ -432,7 +432,7 @@ describe('Audit', function() {
audit.resetRulesAndChecks();
assert.equal(audit.brand, 'axe');
});
- it('should reset brand application', function() {
+ it('should reset brand application', function () {
var audit = new Audit();
assert.equal(audit.application, 'axeAPI');
audit.setBranding({
@@ -442,7 +442,7 @@ describe('Audit', function() {
audit.resetRulesAndChecks();
assert.equal(audit.application, 'axeAPI');
});
- it('should reset brand tagExlcude', function() {
+ it('should reset brand tagExlcude', function () {
axe._load({});
assert.deepEqual(axe._audit.tagExclude, ['experimental']);
axe.configure({
@@ -452,14 +452,14 @@ describe('Audit', function() {
assert.deepEqual(axe._audit.tagExclude, ['experimental']);
});
- it('should reset noHtml', function() {
+ it('should reset noHtml', function () {
var audit = new Audit();
audit.noHtml = true;
audit.resetRulesAndChecks();
assert.isFalse(audit.noHtml);
});
- it('should reset allowedOrigins', function() {
+ it('should reset allowedOrigins', function () {
var audit = new Audit();
audit.allowedOrigins = ['hello'];
audit.resetRulesAndChecks();
@@ -467,8 +467,8 @@ describe('Audit', function() {
});
});
- describe('Audit#addCheck', function() {
- it('should create a new check', function() {
+ describe('Audit#addCheck', function () {
+ it('should create a new check', function () {
var audit = new Audit();
assert.equal(audit.checks.target, undefined);
audit.addCheck({
@@ -478,7 +478,7 @@ describe('Audit', function() {
assert.ok(audit.checks.target);
assert.deepEqual(audit.checks.target.options, { value: 'jane' });
});
- it('should configure the metadata, if passed', function() {
+ it('should configure the metadata, if passed', function () {
var audit = new Audit();
assert.equal(audit.checks.target, undefined);
audit.addCheck({
@@ -488,9 +488,9 @@ describe('Audit', function() {
assert.ok(audit.checks.target);
assert.equal(audit.data.checks.target.guy, 'bob');
});
- it('should reconfigure existing check', function() {
+ it('should reconfigure existing check', function () {
var audit = new Audit();
- var myTest = function() {};
+ var myTest = function () {};
audit.addCheck({
id: 'target',
evaluate: myTest,
@@ -507,7 +507,7 @@ describe('Audit', function() {
assert.equal(audit.checks.target.evaluate, myTest);
assert.deepEqual(audit.checks.target.options, { value: 'fred' });
});
- it('should not turn messages into a function', function() {
+ it('should not turn messages into a function', function () {
var audit = new Audit();
var spec = {
id: 'target',
@@ -525,7 +525,7 @@ describe('Audit', function() {
assert.equal(audit.data.checks.target.messages.fail, 'it failed');
});
- it('should turn function strings into a function', function() {
+ it('should turn function strings into a function', function () {
var audit = new Audit();
var spec = {
id: 'target',
@@ -544,8 +544,8 @@ describe('Audit', function() {
});
});
- describe('Audit#setAllowedOrigins', function() {
- it('should set allowedOrigins', function() {
+ describe('Audit#setAllowedOrigins', function () {
+ it('should set allowedOrigins', function () {
var audit = new Audit();
audit.setAllowedOrigins([
'https://deque.com',
@@ -557,7 +557,7 @@ describe('Audit', function() {
]);
});
- it('should normalize
', function() {
+ it('should normalize ', function () {
var audit = new Audit();
audit.setAllowedOrigins(['', 'https://deque.com']);
assert.deepEqual(audit.allowedOrigins, [
@@ -566,7 +566,7 @@ describe('Audit', function() {
]);
});
- it('should normalize ', function() {
+ it('should normalize ', function () {
var audit = new Audit();
audit.setAllowedOrigins([
'https://deque.com',
@@ -577,8 +577,8 @@ describe('Audit', function() {
});
});
- describe('Audit#run', function() {
- it('should run all the rules', function(done) {
+ describe('Audit#run', function () {
+ it('should run all the rules', function (done) {
fixture.innerHTML =
' ' +
'bananas
' +
@@ -588,7 +588,7 @@ describe('Audit', function() {
a.run(
{ include: [axe.utils.getFlattenedTree(fixture)[0]] },
{},
- function(results) {
+ function (results) {
var expected = [
{
id: 'positive1',
@@ -621,7 +621,7 @@ describe('Audit', function() {
];
var out = results[0].nodes[0].node.source;
- results.forEach(function(res) {
+ results.forEach(function (res) {
// attribute order is a pain in the lower back in IE, so we're not
// comparing nodes. Check.run and Rule.run do this.
res.nodes = '...other tests cover this...';
@@ -638,7 +638,7 @@ describe('Audit', function() {
);
});
- it('should not run rules disabled by the options', function(done) {
+ it('should not run rules disabled by the options', function (done) {
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
{
@@ -648,7 +648,7 @@ describe('Audit', function() {
}
}
},
- function(results) {
+ function (results) {
assert.equal(results.length, 3);
done();
},
@@ -656,7 +656,7 @@ describe('Audit', function() {
);
});
- it('should ensure audit.run recieves preload options', function(done) {
+ it('should ensure audit.run recieves preload options', function (done) {
fixture.innerHTML = ' ';
var audit = new Audit();
@@ -664,12 +664,12 @@ describe('Audit', function() {
id: 'preload1',
selector: '*'
});
- audit.run = function(context, options, resolve, reject) {
+ audit.run = function (context, options, resolve, reject) {
var randomRule = this.rules[0];
randomRule.run(
context,
options,
- function(ruleResult) {
+ function (ruleResult) {
ruleResult.OPTIONS_PASSED = options;
resolve([ruleResult]);
},
@@ -687,7 +687,7 @@ describe('Audit', function() {
{
preload: preloadOptions
},
- function(res) {
+ function (res) {
assert.isDefined(res);
assert.lengthOf(res, 1);
@@ -706,7 +706,7 @@ describe('Audit', function() {
);
});
- it.skip('should run rules (that do not need preload) and preload assets simultaneously', function(done) {
+ it.skip('should run rules (that do not need preload) and preload assets simultaneously', function (done) {
/**
* Note:
* overriding and resolving both check and preload with a delay,
@@ -722,12 +722,12 @@ describe('Audit', function() {
var preloadOverrideInvoked = false;
// override preload method
- axe.utils.preload = function(options) {
+ axe.utils.preload = function (options) {
preloadInvokedTime = new Date();
preloadOverrideInvoked = true;
- return new Promise(function(res, rej) {
- setTimeout(function() {
+ return new Promise(function (res, rej) {
+ setTimeout(function () {
res(true);
}, 2000);
});
@@ -743,11 +743,11 @@ describe('Audit', function() {
});
audit.addCheck({
id: 'no-preload-check',
- evaluate: function(node, options, vNode, context) {
+ evaluate: function (node, options, vNode, context) {
noPreloadCheckedInvokedTime = new Date();
noPreloadRuleCheckEvaluateInvoked = true;
var ready = this.async();
- setTimeout(function() {
+ setTimeout(function () {
ready(true);
}, 1000);
}
@@ -773,7 +773,7 @@ describe('Audit', function() {
{
preload: preloadOptions
},
- function(results) {
+ function (results) {
assert.isDefined(results);
// assert that check was invoked for rule(s)
assert.isTrue(noPreloadRuleCheckEvaluateInvoked);
@@ -797,7 +797,7 @@ describe('Audit', function() {
);
});
- it.skip('should pass assets from preload to rule check that needs assets as context', function(done) {
+ it.skip('should pass assets from preload to rule check that needs assets as context', function (done) {
fixture.innerHTML = '
';
var yesPreloadRuleCheckEvaluateInvoked = false;
@@ -807,7 +807,7 @@ describe('Audit', function() {
data: 'you got it!'
};
// override preload method
- axe.utils.preload = function(options) {
+ axe.utils.preload = function (options) {
preloadOverrideInvoked = true;
return Promise.resolve({
cssom: preloadData
@@ -830,7 +830,7 @@ describe('Audit', function() {
});
audit.addCheck({
id: 'yes-preload-check',
- evaluate: function(node, options, vNode, context) {
+ evaluate: function (node, options, vNode, context) {
yesPreloadRuleCheckEvaluateInvoked = true;
this.data(context);
return true;
@@ -847,7 +847,7 @@ describe('Audit', function() {
{
preload: preloadOptions
},
- function(results) {
+ function (results) {
assert.isDefined(results);
// assert that check was invoked for rule(s)
assert.isTrue(yesPreloadRuleCheckEvaluateInvoked);
@@ -855,7 +855,7 @@ describe('Audit', function() {
assert.isTrue(preloadOverrideInvoked);
// assert preload data that was passed to check
- var ruleResult = results.filter(function(r) {
+ var ruleResult = results.filter(function (r) {
return (r.id = 'yes-preload' && r.nodes.length > 0);
})[0];
var checkResult = ruleResult.nodes[0].any[0];
@@ -871,7 +871,7 @@ describe('Audit', function() {
);
});
- it.skip('should continue to run rules and return result when preload is rejected', function(done) {
+ it.skip('should continue to run rules and return result when preload is rejected', function (done) {
fixture.innerHTML = '
';
var preloadOverrideInvoked = false;
@@ -880,7 +880,7 @@ describe('Audit', function() {
'Boom! Things went terribly wrong! (But this was intended in this test)';
// override preload method
- axe.utils.preload = function(options) {
+ axe.utils.preload = function (options) {
preloadOverrideInvoked = true;
return Promise.reject(rejectionMsg);
};
@@ -901,7 +901,7 @@ describe('Audit', function() {
});
audit.addCheck({
id: 'yes-preload-check',
- evaluate: function(node, options, vNode, context) {
+ evaluate: function (node, options, vNode, context) {
preloadNeededCheckInvoked = true;
this.data(context);
return true;
@@ -918,7 +918,7 @@ describe('Audit', function() {
{
preload: preloadOptions
},
- function(results) {
+ function (results) {
assert.isDefined(results);
// assert preload was invoked
assert.isTrue(preloadOverrideInvoked);
@@ -929,7 +929,7 @@ describe('Audit', function() {
// assert that because preload failed
// cssom was not populated on context of repective check
assert.isTrue(preloadNeededCheckInvoked);
- var ruleResult = results.filter(function(r) {
+ var ruleResult = results.filter(function (r) {
return (r.id = 'yes-preload' && r.nodes.length > 0);
})[0];
var checkResult = ruleResult.nodes[0].any[0];
@@ -942,7 +942,7 @@ describe('Audit', function() {
);
});
- it('should continue to run rules and return result when axios time(s)out and rejects preload', function(done) {
+ it('should continue to run rules and return result when axios time(s)out and rejects preload', function (done) {
fixture.innerHTML = '
';
// there is no stubbing here,
@@ -965,7 +965,7 @@ describe('Audit', function() {
});
audit.addCheck({
id: 'yes-preload-check',
- evaluate: function(node, options, vNode, context) {
+ evaluate: function (node, options, vNode, context) {
preloadNeededCheckInvoked = true;
this.data(context);
return true;
@@ -983,7 +983,7 @@ describe('Audit', function() {
{
preload: preloadOptions
},
- function(results) {
+ function (results) {
assert.isDefined(results);
// assert that both rules ran, although preload failed
assert.lengthOf(results, 2);
@@ -991,7 +991,7 @@ describe('Audit', function() {
// assert that because preload failed
// cssom was not populated on context of repective check
assert.isTrue(preloadNeededCheckInvoked);
- var ruleResult = results.filter(function(r) {
+ var ruleResult = results.filter(function (r) {
return (r.id = 'yes-preload' && r.nodes.length > 0);
})[0];
var checkResult = ruleResult.nodes[0].any[0];
@@ -1004,16 +1004,16 @@ describe('Audit', function() {
);
});
- it.skip('should assign an empty array to axe._selectCache', function(done) {
+ it.skip('should assign an empty array to axe._selectCache', function (done) {
var saved = axe.utils.ruleShouldRun;
- axe.utils.ruleShouldRun = function() {
+ axe.utils.ruleShouldRun = function () {
assert.equal(axe._selectCache.length, 0);
return false;
};
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
{},
- function() {
+ function () {
axe.utils.ruleShouldRun = saved;
done();
},
@@ -1021,13 +1021,13 @@ describe('Audit', function() {
);
});
- it('should clear axe._selectCache', function(done) {
+ it('should clear axe._selectCache', function (done) {
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
{
rules: {}
},
- function() {
+ function () {
assert.isTrue(typeof axe._selectCache === 'undefined');
done();
},
@@ -1035,7 +1035,7 @@ describe('Audit', function() {
);
});
- it('should not run rules disabled by the configuration', function(done) {
+ it('should not run rules disabled by the configuration', function (done) {
var a = new Audit();
var success = true;
a.rules.push(
@@ -1046,7 +1046,7 @@ describe('Audit', function() {
any: [
{
id: 'positive1-check1',
- evaluate: function() {
+ evaluate: function () {
success = false;
}
}
@@ -1056,7 +1056,7 @@ describe('Audit', function() {
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
{},
- function() {
+ function () {
assert.ok(success);
done();
},
@@ -1064,7 +1064,7 @@ describe('Audit', function() {
);
});
- it("should call the rule's run function", function(done) {
+ it("should call the rule's run function", function (done) {
var targetRule = mockRules[mockRules.length - 1],
rule = axe.utils.findBy(a.rules, 'id', targetRule.id),
called = false,
@@ -1072,14 +1072,14 @@ describe('Audit', function() {
fixture.innerHTML = 'link ';
orig = rule.run;
- rule.run = function(node, options, callback) {
+ rule.run = function (node, options, callback) {
called = true;
callback({});
};
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
{},
- function() {
+ function () {
assert.isTrue(called);
rule.run = orig;
done();
@@ -1088,7 +1088,7 @@ describe('Audit', function() {
);
});
- it('should pass the option to the run function', function(done) {
+ it('should pass the option to the run function', function (done) {
var targetRule = mockRules[mockRules.length - 1],
rule = axe.utils.findBy(a.rules, 'id', targetRule.id),
passed = false,
@@ -1097,7 +1097,7 @@ describe('Audit', function() {
fixture.innerHTML = 'link ';
orig = rule.run;
- rule.run = function(node, o, callback) {
+ rule.run = function (node, o, callback) {
assert.deepEqual(o, options);
passed = true;
callback({});
@@ -1107,7 +1107,7 @@ describe('Audit', function() {
a.run(
{ include: [axe.utils.getFlattenedTree()[0]] },
options,
- function() {
+ function () {
assert.ok(passed);
rule.run = orig;
done();
@@ -1116,14 +1116,14 @@ describe('Audit', function() {
);
});
- it('should skip pageLevel rules if context is not set to entire page', function() {
+ it('should skip pageLevel rules if context is not set to entire page', function () {
var audit = new Audit();
audit.rules.push(
new Rule({
pageLevel: true,
enabled: true,
- evaluate: function() {
+ evaluate: function () {
assert.ok(false, 'Should not run');
}
})
@@ -1135,14 +1135,14 @@ describe('Audit', function() {
page: false
},
{},
- function(results) {
+ function (results) {
assert.deepEqual(results, []);
},
isNotCalled
);
});
- it('catches errors and passes them as a cantTell result', function(done) {
+ it('catches errors and passes them as a cantTell result', function (done) {
var err = new Error('Launch the super sheep!');
a.addRule({
id: 'throw1',
@@ -1155,7 +1155,7 @@ describe('Audit', function() {
});
a.addCheck({
id: 'throw1-check1',
- evaluate: function() {
+ evaluate: function () {
throw err;
}
});
@@ -1169,7 +1169,7 @@ describe('Audit', function() {
values: ['throw1']
}
},
- function(results) {
+ function (results) {
assert.lengthOf(results, 1);
assert.equal(results[0].result, 'cantTell');
assert.equal(results[0].message, err.message);
@@ -1181,7 +1181,7 @@ describe('Audit', function() {
);
});
- it('should not halt if errors occur', function(done) {
+ it('should not halt if errors occur', function (done) {
a.addRule({
id: 'throw1',
selector: '*',
@@ -1193,7 +1193,7 @@ describe('Audit', function() {
});
a.addCheck({
id: 'throw1-check1',
- evaluate: function() {
+ evaluate: function () {
throw new Error('Launch the super sheep!');
}
});
@@ -1205,14 +1205,14 @@ describe('Audit', function() {
values: ['throw1', 'positive1']
}
},
- function() {
+ function () {
done();
},
isNotCalled
);
});
- it('should run audit.normalizeOptions to ensure valid input', function() {
+ it('should run audit.normalizeOptions to ensure valid input', function () {
fixture.innerHTML =
' ' +
'bananas
' +
@@ -1220,7 +1220,7 @@ describe('Audit', function() {
'FAIL ME ';
var checked = 'options not validated';
- a.normalizeOptions = function() {
+ a.normalizeOptions = function () {
checked = 'options validated';
};
@@ -1233,7 +1233,7 @@ describe('Audit', function() {
assert.equal(checked, 'options validated');
});
- it('should halt if an error occurs when debug is set', function(done) {
+ it('should halt if an error occurs when debug is set', function (done) {
a.addRule({
id: 'throw1',
selector: '*',
@@ -1245,7 +1245,7 @@ describe('Audit', function() {
});
a.addCheck({
id: 'throw1-check1',
- evaluate: function() {
+ evaluate: function () {
throw new Error('Launch the super sheep!');
}
});
@@ -1263,7 +1263,7 @@ describe('Audit', function() {
}
},
noop,
- function(err) {
+ function (err) {
assert.equal(err.message, 'Launch the super sheep!');
done();
}
@@ -1271,8 +1271,8 @@ describe('Audit', function() {
});
});
- describe('Audit#after', function() {
- it('should run Rule#after on any rule whose result is passed in', function() {
+ describe('Audit#after', function () {
+ it('should run Rule#after on any rule whose result is passed in', function () {
/*eslint no-unused-vars:0*/
var audit = new Audit();
var success = false;
@@ -1291,7 +1291,7 @@ describe('Audit', function() {
})
);
- audit.rules[0].after = function(res, opts) {
+ audit.rules[0].after = function (res, opts) {
assert.equal(res, results[0]);
assert.deepEqual(opts, options);
success = true;
@@ -1301,16 +1301,16 @@ describe('Audit', function() {
});
});
- describe('Audit#normalizeOptions', function() {
+ describe('Audit#normalizeOptions', function () {
var axeLog;
- beforeEach(function() {
+ beforeEach(function () {
axeLog = axe.log;
});
- afterEach(function() {
+ afterEach(function () {
axe.log = axeLog;
});
- it('returns the options object when it is valid', function() {
+ it('returns the options object when it is valid', function () {
var opt = {
runOnly: {
type: 'rule',
@@ -1323,7 +1323,7 @@ describe('Audit', function() {
assert(a.normalizeOptions(opt), opt);
});
- it('allows `value` as alternative to `values`', function() {
+ it('allows `value` as alternative to `values`', function () {
var opt = {
runOnly: {
type: 'rule',
@@ -1335,7 +1335,7 @@ describe('Audit', function() {
assert.isUndefined(out.runOnly.value);
});
- it('allows type: rules as an alternative to type: rule', function() {
+ it('allows type: rules as an alternative to type: rule', function () {
var opt = {
runOnly: {
type: 'rules',
@@ -1345,7 +1345,7 @@ describe('Audit', function() {
assert(a.normalizeOptions(opt).runOnly.type, 'rule');
});
- it('allows type: tags as an alternative to type: tag', function() {
+ it('allows type: tags as an alternative to type: tag', function () {
var opt = {
runOnly: {
type: 'tags',
@@ -1355,7 +1355,7 @@ describe('Audit', function() {
assert(a.normalizeOptions(opt).runOnly.type, 'tag');
});
- it('allows type: undefined as an alternative to type: tag', function() {
+ it('allows type: undefined as an alternative to type: tag', function () {
var opt = {
runOnly: {
values: ['positive']
@@ -1364,44 +1364,44 @@ describe('Audit', function() {
assert(a.normalizeOptions(opt).runOnly.type, 'tag');
});
- it('allows runOnly as an array as an alternative to type: tag', function() {
+ it('allows runOnly as an array as an alternative to type: tag', function () {
var opt = { runOnly: ['positive', 'negative'] };
var out = a.normalizeOptions(opt);
assert(out.runOnly.type, 'tag');
assert.deepEqual(out.runOnly.values, ['positive', 'negative']);
});
- it('allows runOnly as an array as an alternative to type: rule', function() {
+ it('allows runOnly as an array as an alternative to type: rule', function () {
var opt = { runOnly: ['positive1', 'negative1'] };
var out = a.normalizeOptions(opt);
assert(out.runOnly.type, 'rule');
assert.deepEqual(out.runOnly.values, ['positive1', 'negative1']);
});
- it('allows runOnly as a string as an alternative to an array', function() {
+ it('allows runOnly as a string as an alternative to an array', function () {
var opt = { runOnly: 'positive1' };
var out = a.normalizeOptions(opt);
assert(out.runOnly.type, 'rule');
assert.deepEqual(out.runOnly.values, ['positive1']);
});
- it('throws an error if runOnly contains both rules and tags', function() {
- assert.throws(function() {
+ it('throws an error if runOnly contains both rules and tags', function () {
+ assert.throws(function () {
a.normalizeOptions({
runOnly: ['positive', 'negative1']
});
});
});
- it('defaults runOnly to type: tag', function() {
+ it('defaults runOnly to type: tag', function () {
var opt = { runOnly: ['fakeTag'] };
var out = a.normalizeOptions(opt);
assert(out.runOnly.type, 'tag');
assert.deepEqual(out.runOnly.values, ['fakeTag']);
});
- it('throws an error runOnly.values not an array', function() {
- assert.throws(function() {
+ it('throws an error runOnly.values not an array', function () {
+ assert.throws(function () {
a.normalizeOptions({
runOnly: {
type: 'rule',
@@ -1411,8 +1411,8 @@ describe('Audit', function() {
});
});
- it('throws an error runOnly.values an empty', function() {
- assert.throws(function() {
+ it('throws an error runOnly.values an empty', function () {
+ assert.throws(function () {
a.normalizeOptions({
runOnly: {
type: 'rule',
@@ -1422,8 +1422,8 @@ describe('Audit', function() {
});
});
- it('throws an error runOnly.type is unknown', function() {
- assert.throws(function() {
+ it('throws an error runOnly.type is unknown', function () {
+ assert.throws(function () {
a.normalizeOptions({
runOnly: {
type: 'something-else',
@@ -1433,8 +1433,8 @@ describe('Audit', function() {
});
});
- it('throws an error when option.runOnly has an unknown rule', function() {
- assert.throws(function() {
+ it('throws an error when option.runOnly has an unknown rule', function () {
+ assert.throws(function () {
a.normalizeOptions({
runOnly: {
type: 'rule',
@@ -1444,8 +1444,8 @@ describe('Audit', function() {
});
});
- it("doesn't throw an error when option.runOnly has an unknown tag", function() {
- assert.doesNotThrow(function() {
+ it("doesn't throw an error when option.runOnly has an unknown tag", function () {
+ assert.doesNotThrow(function () {
a.normalizeOptions({
runOnly: {
type: 'tags',
@@ -1455,8 +1455,8 @@ describe('Audit', function() {
});
});
- it('throws an error when option.rules has an unknown rule', function() {
- assert.throws(function() {
+ it('throws an error when option.rules has an unknown rule', function () {
+ assert.throws(function () {
a.normalizeOptions({
rules: {
fakeRule: { enabled: false }
@@ -1465,9 +1465,9 @@ describe('Audit', function() {
});
});
- it('logs an issue when a tag is unknown', function() {
+ it('logs an issue when a tag is unknown', function () {
var message = '';
- axe.log = function(m) {
+ axe.log = function (m) {
message = m;
};
a.normalizeOptions({
@@ -1479,9 +1479,9 @@ describe('Audit', function() {
assert.include(message, 'Could not find tags');
});
- it('logs no issues for unknown WCAG level tags', function() {
+ it('logs no issues for unknown WCAG level tags', function () {
var message = '';
- axe.log = function(m) {
+ axe.log = function (m) {
message = m;
};
a.normalizeOptions({
@@ -1493,9 +1493,9 @@ describe('Audit', function() {
assert.isEmpty(message);
});
- it('logs an issue when a tag is unknown, together with a wcag level tag', function() {
+ it('logs an issue when a tag is unknown, together with a wcag level tag', function () {
var message = '';
- axe.log = function(m) {
+ axe.log = function (m) {
message = m;
};
a.normalizeOptions({
diff --git a/test/core/base/check-result.js b/test/core/base/check-result.js
index eee4cfa099..5b85f5cf81 100644
--- a/test/core/base/check-result.js
+++ b/test/core/base/check-result.js
@@ -1,27 +1,27 @@
-describe('CheckResult', function() {
+describe('CheckResult', function () {
'use strict';
var CheckResult = axe._thisWillBeDeletedDoNotUse.base.CheckResult;
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(CheckResult);
});
- it('should have an id', function() {
+ it('should have an id', function () {
var result = new CheckResult({ id: 'monkeys' });
assert.equal(result.id, 'monkeys');
});
- it('should set `data` to `null`', function() {
+ it('should set `data` to `null`', function () {
var result = new CheckResult({});
assert.isNull(result.data);
});
- it('should set `relatedNodes` to `[]`', function() {
+ it('should set `relatedNodes` to `[]`', function () {
var result = new CheckResult({});
assert.deepEqual(result.relatedNodes, []);
});
- it('should set `result` to `null`', function() {
+ it('should set `result` to `null`', function () {
var result = new CheckResult({});
assert.isNull(result.result);
});
diff --git a/test/core/base/check.js b/test/core/base/check.js
index b399364efa..82a7ebe6b4 100644
--- a/test/core/base/check.js
+++ b/test/core/base/check.js
@@ -1,40 +1,40 @@
-describe('Check', function() {
+describe('Check', function () {
'use strict';
var Check = axe._thisWillBeDeletedDoNotUse.base.Check;
var CheckResult = axe._thisWillBeDeletedDoNotUse.base.CheckResult;
var metadataFunctionMap =
axe._thisWillBeDeletedDoNotUse.base.metadataFunctionMap;
- var noop = function() {};
+ var noop = function () {};
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(Check);
});
- describe('prototype', function() {
- describe('enabled', function() {
- it('should be true by default', function() {
+ describe('prototype', function () {
+ describe('enabled', function () {
+ it('should be true by default', function () {
var check = new Check({});
assert.isTrue(check.enabled);
});
- it('should be set to whatever is passed in', function() {
+ it('should be set to whatever is passed in', function () {
var check = new Check({ enabled: false });
assert.isFalse(check.enabled);
});
});
- describe('configure', function() {
- it('should accept one parameter', function() {
+ describe('configure', function () {
+ it('should accept one parameter', function () {
assert.lengthOf(new Check({}).configure, 1);
});
- it('should override options', function() {
- Check.prototype.test = function() {
+ it('should override options', function () {
+ Check.prototype.test = function () {
return this.options;
};
var check = new Check({
@@ -44,8 +44,8 @@ describe('Check', function() {
assert.deepEqual({ value: 'fong' }, check.test());
delete Check.prototype.test;
});
- it('should override evaluate', function() {
- Check.prototype.test = function() {
+ it('should override evaluate', function () {
+ Check.prototype.test = function () {
return this.evaluate();
};
var check = new Check({
@@ -55,8 +55,8 @@ describe('Check', function() {
assert.equal('fong', check.test());
delete Check.prototype.test;
});
- it('should override after', function() {
- Check.prototype.test = function() {
+ it('should override after', function () {
+ Check.prototype.test = function () {
return this.after();
};
var check = new Check({
@@ -66,46 +66,46 @@ describe('Check', function() {
assert.equal('fong', check.test());
delete Check.prototype.test;
});
- it('should override evaluate as a function', function() {
- Check.prototype.test = function() {
+ it('should override evaluate as a function', function () {
+ Check.prototype.test = function () {
return this.evaluate();
};
var check = new Check({
- evaluate: function() {
+ evaluate: function () {
return 'foo';
}
});
check.configure({
- evaluate: function() {
+ evaluate: function () {
return 'fong';
}
});
assert.equal('fong', check.test());
delete Check.prototype.test;
});
- it('should override after as a function', function() {
- Check.prototype.test = function() {
+ it('should override after as a function', function () {
+ Check.prototype.test = function () {
return this.after();
};
var check = new Check({
- after: function() {
+ after: function () {
return 'foo';
}
});
check.configure({
- after: function() {
+ after: function () {
return 'fong';
}
});
assert.equal('fong', check.test());
delete Check.prototype.test;
});
- it('should override evaluate as ID', function() {
- metadataFunctionMap['custom-evaluate'] = function() {
+ it('should override evaluate as ID', function () {
+ metadataFunctionMap['custom-evaluate'] = function () {
return 'fong';
};
- Check.prototype.test = function() {
+ Check.prototype.test = function () {
return this.evaluate();
};
var check = new Check({
@@ -116,12 +116,12 @@ describe('Check', function() {
delete Check.prototype.test;
delete metadataFunctionMap['custom-evaluate'];
});
- it('should override after as ID', function() {
- metadataFunctionMap['custom-after'] = function() {
+ it('should override after as ID', function () {
+ metadataFunctionMap['custom-after'] = function () {
return 'fong';
};
- Check.prototype.test = function() {
+ Check.prototype.test = function () {
return this.after();
};
var check = new Check({
@@ -132,7 +132,7 @@ describe('Check', function() {
delete Check.prototype.test;
delete metadataFunctionMap['custom-after'];
});
- it('should error if evaluate does not match an ID', function() {
+ it('should error if evaluate does not match an ID', function () {
function fn() {
var check = new Check({});
check.configure({ evaluate: 'does-not-exist' });
@@ -143,7 +143,7 @@ describe('Check', function() {
'Function ID does not exist in the metadata-function-map: does-not-exist'
);
});
- it('should error if after does not match an ID', function() {
+ it('should error if after does not match an ID', function () {
function fn() {
var check = new Check({});
check.configure({ after: 'does-not-exist' });
@@ -154,8 +154,8 @@ describe('Check', function() {
'Function ID does not exist in the metadata-function-map: does-not-exist'
);
});
- it('should override enabled', function() {
- Check.prototype.test = function() {
+ it('should override enabled', function () {
+ Check.prototype.test = function () {
return this.enabled;
};
var check = new Check({
@@ -165,8 +165,8 @@ describe('Check', function() {
assert.equal(false, check.test());
delete Check.prototype.test;
});
- it('should NOT override id', function() {
- Check.prototype.test = function() {
+ it('should NOT override id', function () {
+ Check.prototype.test = function () {
return this.id;
};
var check = new Check({
@@ -176,8 +176,8 @@ describe('Check', function() {
assert.equal('fong', check.test());
delete Check.prototype.test;
});
- it('should NOT override any random property', function() {
- Check.prototype.test = function() {
+ it('should NOT override any random property', function () {
+ Check.prototype.test = function () {
return this.random;
};
var check = new Check({});
@@ -187,47 +187,47 @@ describe('Check', function() {
});
});
- describe('run', function() {
- it('should accept 5 parameters', function() {
+ describe('run', function () {
+ it('should accept 5 parameters', function () {
assert.lengthOf(new Check({}).run, 5);
});
- it('should pass the node through', function(done) {
+ it('should pass the node through', function (done) {
new Check({
- evaluate: function(node) {
+ evaluate: function (node) {
assert.equal(node, fixture);
done();
}
}).run(axe.utils.getFlattenedTree(fixture)[0], {}, {}, noop);
});
- it('should pass the options through', function(done) {
+ it('should pass the options through', function (done) {
var expected = { monkeys: 'bananas' };
new Check({
options: expected,
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, expected);
done();
}
}).run(fixture, {}, {}, noop);
});
- it('should pass the options through modified by the ones passed into the call', function(done) {
+ it('should pass the options through modified by the ones passed into the call', function (done) {
var configured = { monkeys: 'bananas' },
expected = { monkeys: 'bananas', dogs: 'cats' };
new Check({
options: configured,
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, expected);
done();
}
}).run(fixture, { options: expected }, {}, noop);
});
- it('should normalize non-object options for internal checks', function(done) {
- metadataFunctionMap['custom-check'] = function(node, options) {
+ it('should normalize non-object options for internal checks', function (done) {
+ metadataFunctionMap['custom-check'] = function (node, options) {
assert.deepEqual(options, { value: 'foo' });
done();
};
@@ -237,16 +237,16 @@ describe('Check', function() {
delete metadataFunctionMap['custom-check'];
});
- it('should not normalize non-object options for external checks', function(done) {
+ it('should not normalize non-object options for external checks', function (done) {
new Check({
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, 'foo');
done();
}
}).run(fixture, { options: 'foo' }, {}, noop);
});
- it('should pass the context through to check evaluate call', function(done) {
+ it('should pass the context through to check evaluate call', function (done) {
var configured = {
cssom: 'yay',
source: 'this is page source',
@@ -254,7 +254,7 @@ describe('Check', function() {
};
new Check({
options: configured,
- evaluate: function(node, options, virtualNode, context) {
+ evaluate: function (node, options, virtualNode, context) {
assert.property(context, 'cssom');
assert.deepEqual(context, configured);
done();
@@ -262,33 +262,33 @@ describe('Check', function() {
}).run(fixture, {}, configured, noop);
});
- it('should pass the virtual node through', function(done) {
+ it('should pass the virtual node through', function (done) {
var tree = axe.utils.getFlattenedTree(fixture);
new Check({
- evaluate: function(node, options, virtualNode) {
+ evaluate: function (node, options, virtualNode) {
assert.equal(virtualNode, tree[0]);
done();
}
}).run(tree[0]);
});
- it.skip('should bind context to `bindCheckResult`', function(done) {
+ it.skip('should bind context to `bindCheckResult`', function (done) {
var orig = axe.utils.checkHelper,
- cb = function() {
+ cb = function () {
return true;
},
options = {},
context = {},
result = { monkeys: 'bananas' };
- axe.utils.checkHelper = function(checkResult, options, callback) {
+ axe.utils.checkHelper = function (checkResult, options, callback) {
assert.instanceOf(checkResult, window.CheckResult);
assert.equal(callback, cb);
return result;
};
new Check({
- evaluate: function() {
+ evaluate: function () {
assert.deepEqual(result, this);
axe.utils.checkHelper = orig;
done();
@@ -296,66 +296,66 @@ describe('Check', function() {
}).run(fixture, options, context, cb);
});
- it('should allow for asynchronous checks', function(done) {
+ it('should allow for asynchronous checks', function (done) {
var data = { monkeys: 'bananas' };
new Check({
- evaluate: function() {
+ evaluate: function () {
var ready = this.async();
- setTimeout(function() {
+ setTimeout(function () {
ready(data);
}, 10);
}
- }).run(fixture, {}, {}, function(d) {
+ }).run(fixture, {}, {}, function (d) {
assert.instanceOf(d, CheckResult);
assert.deepEqual(d.result, data);
done();
});
});
- it('should pass `null` as the parameter if not enabled', function(done) {
+ it('should pass `null` as the parameter if not enabled', function (done) {
new Check({
- evaluate: function() {},
+ evaluate: function () {},
enabled: false
- }).run(fixture, {}, {}, function(data) {
+ }).run(fixture, {}, {}, function (data) {
assert.isNull(data);
done();
});
});
- it('should pass `null` as the parameter if options disable', function(done) {
+ it('should pass `null` as the parameter if options disable', function (done) {
new Check({
- evaluate: function() {}
+ evaluate: function () {}
}).run(
fixture,
{
enabled: false
},
{},
- function(data) {
+ function (data) {
assert.isNull(data);
done();
}
);
});
- it('passes a result to the resolve argument', function(done) {
+ it('passes a result to the resolve argument', function (done) {
new Check({
- evaluate: function() {
+ evaluate: function () {
return true;
}
- }).run(fixture, {}, {}, function(data) {
+ }).run(fixture, {}, {}, function (data) {
assert.instanceOf(data, CheckResult);
assert.isTrue(data.result);
done();
});
});
- it('should pass errors to the reject argument', function(done) {
+ it('should pass errors to the reject argument', function (done) {
new Check({
- evaluate: function() {
+ evaluate: function () {
throw new Error('Grenade!');
}
- }).run(fixture, {}, {}, noop, function(err) {
+ }).run(fixture, {}, {}, noop, function (err) {
assert.instanceOf(err, Error);
assert.equal(err.message, 'Grenade!');
done();
@@ -363,44 +363,44 @@ describe('Check', function() {
});
});
- describe('runSync', function() {
- it('should accept 3 parameters', function() {
+ describe('runSync', function () {
+ it('should accept 3 parameters', function () {
assert.lengthOf(new Check({}).runSync, 3);
});
- it('should pass the node through', function() {
+ it('should pass the node through', function () {
new Check({
- evaluate: function(node) {
+ evaluate: function (node) {
assert.equal(node, fixture);
}
}).runSync(axe.utils.getFlattenedTree(fixture)[0], {}, {});
});
- it('should pass the options through', function() {
+ it('should pass the options through', function () {
var expected = { monkeys: 'bananas' };
new Check({
options: expected,
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, expected);
}
}).runSync(fixture, {}, {});
});
- it('should pass the options through modified by the ones passed into the call', function() {
+ it('should pass the options through modified by the ones passed into the call', function () {
var configured = { monkeys: 'bananas' },
expected = { monkeys: 'bananas', dogs: 'cats' };
new Check({
options: configured,
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, expected);
}
}).runSync(fixture, { options: expected }, {});
});
- it('should normalize non-object options for internal checks', function(done) {
- metadataFunctionMap['custom-check'] = function(node, options) {
+ it('should normalize non-object options for internal checks', function (done) {
+ metadataFunctionMap['custom-check'] = function (node, options) {
assert.deepEqual(options, { value: 'foo' });
done();
};
@@ -410,16 +410,16 @@ describe('Check', function() {
delete metadataFunctionMap['custom-check'];
});
- it('should not normalize non-object options for external checks', function(done) {
+ it('should not normalize non-object options for external checks', function (done) {
new Check({
- evaluate: function(node, options) {
+ evaluate: function (node, options) {
assert.deepEqual(options, 'foo');
done();
}
}).runSync(fixture, { options: 'foo' }, {});
});
- it('should pass the context through to check evaluate call', function() {
+ it('should pass the context through to check evaluate call', function () {
var configured = {
cssom: 'yay',
source: 'this is page source',
@@ -427,30 +427,30 @@ describe('Check', function() {
};
new Check({
options: configured,
- evaluate: function(node, options, virtualNode, context) {
+ evaluate: function (node, options, virtualNode, context) {
assert.property(context, 'cssom');
assert.deepEqual(context, configured);
}
}).runSync(fixture, {}, configured);
});
- it('should pass the virtual node through', function() {
+ it('should pass the virtual node through', function () {
var tree = axe.utils.getFlattenedTree(fixture);
new Check({
- evaluate: function(node, options, virtualNode) {
+ evaluate: function (node, options, virtualNode) {
assert.equal(virtualNode, tree[0]);
}
}).runSync(tree[0]);
});
- it('should throw error for asynchronous checks', function() {
+ it('should throw error for asynchronous checks', function () {
var data = { monkeys: 'bananas' };
try {
new Check({
- evaluate: function() {
+ evaluate: function () {
var ready = this.async();
- setTimeout(function() {
+ setTimeout(function () {
ready(data);
}, 10);
}
@@ -464,18 +464,18 @@ describe('Check', function() {
}
});
- it('should pass `null` as the parameter if not enabled', function() {
+ it('should pass `null` as the parameter if not enabled', function () {
var data = new Check({
- evaluate: function() {},
+ evaluate: function () {},
enabled: false
}).runSync(fixture, {}, {});
assert.isNull(data);
});
- it('should pass `null` as the parameter if options disable', function() {
+ it('should pass `null` as the parameter if options disable', function () {
var data = new Check({
- evaluate: function() {}
+ evaluate: function () {}
}).runSync(
fixture,
{
@@ -486,9 +486,9 @@ describe('Check', function() {
assert.isNull(data);
});
- it('passes a result to the resolve argument', function() {
+ it('passes a result to the resolve argument', function () {
var data = new Check({
- evaluate: function() {
+ evaluate: function () {
return true;
}
}).runSync(fixture, {}, {});
@@ -496,10 +496,10 @@ describe('Check', function() {
assert.isTrue(data.result);
});
- it('should throw errors', function() {
+ it('should throw errors', function () {
try {
new Check({
- evaluate: function() {
+ evaluate: function () {
throw new Error('Grenade!');
}
}).runSync(fixture, {}, {});
@@ -510,9 +510,9 @@ describe('Check', function() {
});
});
- describe('getOptions', function() {
+ describe('getOptions', function () {
var check;
- beforeEach(function() {
+ beforeEach(function () {
check = new Check({
options: {
foo: 'bar'
@@ -520,56 +520,56 @@ describe('Check', function() {
});
});
- it('should return default check options', function() {
+ it('should return default check options', function () {
assert.deepEqual(check.getOptions(), { foo: 'bar' });
});
- it('should merge options with Check defaults', function() {
+ it('should merge options with Check defaults', function () {
var options = check.getOptions({ hello: 'world' });
assert.deepEqual(options, { foo: 'bar', hello: 'world' });
});
- it('should override defaults', function() {
+ it('should override defaults', function () {
var options = check.getOptions({ foo: 'world' });
assert.deepEqual(options, { foo: 'world' });
});
- it('should normalize passed in options', function() {
+ it('should normalize passed in options', function () {
var options = check.getOptions('world');
assert.deepEqual(options, { foo: 'bar', value: 'world' });
});
});
});
- describe('spec object', function() {
- describe('.id', function() {
- it('should be set', function() {
+ describe('spec object', function () {
+ describe('.id', function () {
+ it('should be set', function () {
var spec = {
id: 'monkeys'
};
assert.equal(new Check(spec).id, spec.id);
});
- it('should have no default', function() {
+ it('should have no default', function () {
var spec = {};
assert.equal(new Check(spec).id, spec.id);
});
});
- describe('.after', function() {
- it('should be set', function() {
+ describe('.after', function () {
+ it('should be set', function () {
var spec = {
- after: function() {}
+ after: function () {}
};
assert.equal(new Check(spec).after, spec.after);
});
- it('should have no default', function() {
+ it('should have no default', function () {
var spec = {};
assert.equal(new Check(spec).after, spec.after);
});
- it('should be able to take a string and turn it into a function', function() {
+ it('should be able to take a string and turn it into a function', function () {
var spec = {
after: 'function () {return "blah";}'
};
@@ -578,44 +578,44 @@ describe('Check', function() {
});
});
- describe('.options', function() {
- it('should be set', function() {
+ describe('.options', function () {
+ it('should be set', function () {
var spec = {
options: { value: ['monkeys', 'bananas'] }
};
assert.equal(new Check(spec).options, spec.options);
});
- it('should have no default', function() {
+ it('should have no default', function () {
var spec = {};
assert.equal(new Check(spec).options, spec.options);
});
- it('should normalize non-object options for internal checks', function() {
+ it('should normalize non-object options for internal checks', function () {
var spec = {
options: 'foo'
};
assert.deepEqual(new Check(spec).options, { value: 'foo' });
});
- it('should not normalize non-object options for external checks', function() {
+ it('should not normalize non-object options for external checks', function () {
var spec = {
options: 'foo',
- evaluate: function() {}
+ evaluate: function () {}
};
assert.deepEqual(new Check(spec).options, 'foo');
});
});
- describe('.evaluate', function() {
- it('should be set', function() {
+ describe('.evaluate', function () {
+ it('should be set', function () {
var spec = {
- evaluate: function() {}
+ evaluate: function () {}
};
assert.equal(typeof new Check(spec).evaluate, 'function');
assert.equal(new Check(spec).evaluate, spec.evaluate);
});
- it('should turn a string into a function', function() {
+ it('should turn a string into a function', function () {
var spec = {
evaluate: 'function () { return "blah";}'
};
diff --git a/test/core/base/context.js b/test/core/base/context.js
index 3e68acae0b..8daa625af8 100644
--- a/test/core/base/context.js
+++ b/test/core/base/context.js
@@ -1,5 +1,5 @@
/*eslint no-unused-vars:0*/
-describe('Context', function() {
+describe('Context', function () {
'use strict';
var Context = axe._thisWillBeDeletedDoNotUse.base.Context;
@@ -10,11 +10,11 @@ describe('Context', function() {
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should not mutate exclude in input', function() {
+ it('should not mutate exclude in input', function () {
fixture.innerHTML = '
';
var context = { exclude: [['iframe', '#foo']] };
// eslint-disable-next-line no-new
@@ -22,7 +22,7 @@ describe('Context', function() {
assert.deepEqual(context, { exclude: [['iframe', '#foo']] });
});
- it('should not mutate its include input', function() {
+ it('should not mutate its include input', function () {
fixture.innerHTML = '
';
var context = { include: [['#foo']] };
// eslint-disable-next-line no-new
@@ -30,7 +30,7 @@ describe('Context', function() {
assert.deepEqual(context, { include: [['#foo']] });
});
- it('should not share memory with complex object', function() {
+ it('should not share memory with complex object', function () {
fixture.innerHTML = '';
var spec = {
include: [['#foo'], ['a']],
@@ -39,32 +39,32 @@ describe('Context', function() {
};
var context = new Context(spec);
assert.notStrictEqual(spec.include, context.include);
- spec.include.forEach(function(_, index) {
+ spec.include.forEach(function (_, index) {
assert.notStrictEqual(spec.include[index], context.include[index]);
});
assert.notStrictEqual(spec.exclude, context.exclude);
- spec.exclude.forEach(function(_, index) {
+ spec.exclude.forEach(function (_, index) {
assert.notStrictEqual(spec.exclude[index], context.exclude[index]);
});
assert.notStrictEqual(spec.size, context.size);
});
- it('should not share memory with simple array', function() {
+ it('should not share memory with simple array', function () {
fixture.innerHTML = '
';
var spec = ['#foo'];
var context = new Context(spec);
assert.notStrictEqual(spec, context.include);
});
- describe('include', function() {
- it('should accept a single selector', function() {
+ describe('include', function () {
+ it('should accept a single selector', function () {
fixture.innerHTML = '
';
var result = new Context('#foo');
assert.deepEqual([result.include[0].actualNode], [$id('foo')]);
});
- it('should accept multiple selectors', function() {
+ it('should accept multiple selectors', function () {
fixture.innerHTML = '';
var result = new Context([['#foo'], ['#bar']]);
@@ -74,7 +74,7 @@ describe('Context', function() {
);
});
- it('should accept a node reference', function() {
+ it('should accept a node reference', function () {
var div = document.createElement('div');
fixture.appendChild(div);
@@ -83,7 +83,7 @@ describe('Context', function() {
assert.deepEqual([result.include[0].actualNode], [div]);
});
- it('should accept a node reference consisting of nested divs', function() {
+ it('should accept a node reference consisting of nested divs', function () {
var div1 = document.createElement('div');
var div2 = document.createElement('div');
@@ -95,7 +95,7 @@ describe('Context', function() {
assert.deepEqual([result.include[0].actualNode], [div1]);
});
- it('should accept a node reference consisting of a form with nested controls', function() {
+ it('should accept a node reference consisting of a form with nested controls', function () {
var form = document.createElement('form');
var input = document.createElement('input');
@@ -107,7 +107,7 @@ describe('Context', function() {
assert.deepEqual([result.include[0].actualNode], [form]);
});
- it('should accept an array of node references', function() {
+ it('should accept an array of node references', function () {
fixture.innerHTML = '';
var result = new Context([$id('foo'), $id('bar')]);
@@ -118,47 +118,47 @@ describe('Context', function() {
);
});
- it('should remove any non-matched reference', function() {
+ it('should remove any non-matched reference', function () {
fixture.innerHTML = '';
var result = new Context([['#foo'], ['#baz'], ['#bar']]);
assert.deepEqual(
- result.include.map(function(n) {
+ result.include.map(function (n) {
return n.actualNode;
}),
[$id('foo'), $id('bar')]
);
});
- it('should sort the include nodes in document order', function() {
+ it('should sort the include nodes in document order', function () {
fixture.innerHTML =
'
';
var result = new Context([['#foo'], ['#baz'], ['#bar']]);
assert.deepEqual(
- result.include.map(function(n) {
+ result.include.map(function (n) {
return n.actualNode;
}),
[$id('foo'), $id('bar'), $id('baz')]
);
});
- it('should remove any null reference', function() {
+ it('should remove any null reference', function () {
fixture.innerHTML = '';
var result = new Context([$id('foo'), $id('bar'), null]);
assert.deepEqual(
- result.include.map(function(n) {
+ result.include.map(function (n) {
return n.actualNode;
}),
[$id('foo'), $id('bar')]
);
});
- it('should accept mixed', function() {
+ it('should accept mixed', function () {
fixture.innerHTML = '';
var div = document.createElement('div');
div.id = 'baz';
@@ -167,14 +167,14 @@ describe('Context', function() {
var result = new Context([['#foo'], ['#bar'], div]);
assert.deepEqual(
- result.include.map(function(n) {
+ result.include.map(function (n) {
return n.actualNode;
}),
[$id('foo'), $id('bar'), $id('baz')]
);
});
- it('should support jQuery-like objects', function() {
+ it('should support jQuery-like objects', function () {
fixture.innerHTML =
'
';
var $test = {
@@ -187,27 +187,27 @@ describe('Context', function() {
var result = new Context($test);
assert.deepEqual(
- result.include.map(function(n) {
+ result.include.map(function (n) {
return n.actualNode;
}),
[$id('foo'), $id('bar'), $id('baz')]
);
});
- describe('throwing errors', function() {
+ describe('throwing errors', function () {
var isInFrame;
- beforeEach(function() {
+ beforeEach(function () {
isInFrame = axe.utils.respondable.isInFrame;
});
- afterEach(function() {
+ afterEach(function () {
axe.utils.respondable.isInFrame = isInFrame;
});
- it('should throw when no elements match the context', function() {
+ it('should throw when no elements match the context', function () {
fixture.innerHTML = '
';
assert.throws(
- function() {
+ function () {
var ctxt = new Context('#notAnElement');
},
Error,
@@ -215,14 +215,14 @@ describe('Context', function() {
);
});
- it.skip('should throw when no elements match the context inside a frame', function() {
- axe.utils.respondable.isInFrame = function() {
+ it.skip('should throw when no elements match the context inside a frame', function () {
+ axe.utils.respondable.isInFrame = function () {
return true;
};
fixture.innerHTML = '
';
assert.throws(
- function() {
+ function () {
var ctxt = new Context('#notAnElement');
},
Error,
@@ -231,15 +231,15 @@ describe('Context', function() {
});
});
- it('should create a flatTree property', function() {
+ it('should create a flatTree property', function () {
var context = new Context({ include: [document] });
assert.isArray(context.flatTree);
assert.isAtLeast(context.flatTree.length, 1);
});
});
- describe('object definition', function() {
- it('should assign include/exclude', function() {
+ describe('object definition', function () {
+ it('should assign include/exclude', function () {
var context = new Context({
include: ['#fixture'],
exclude: ['#mocha']
@@ -259,7 +259,7 @@ describe('Context', function() {
assert.isAtLeast(context.flatTree.length, 1);
});
- it('should disregard bad input, non-matching selectors', function() {
+ it('should disregard bad input, non-matching selectors', function () {
var flatTree = axe.utils.getFlattenedTree(document);
var context = new Context({
include: ['#fixture', '#monkeys'],
@@ -283,7 +283,7 @@ describe('Context', function() {
);
});
- it('should disregard bad input (null)', function() {
+ it('should disregard bad input (null)', function () {
var result = new Context();
assert.lengthOf(result.include, 1);
@@ -297,7 +297,7 @@ describe('Context', function() {
assert.lengthOf(result.frames, 0);
});
- it('should default include to document', function() {
+ it('should default include to document', function () {
var result = new Context({ exclude: ['#fixture'] });
assert.lengthOf(result.include, 1);
assert.equal(result.include[0].actualNode, document.documentElement);
@@ -311,15 +311,15 @@ describe('Context', function() {
assert.lengthOf(result.frames, 0);
});
- it('should default empty include to document', function() {
+ it('should default empty include to document', function () {
var result = new Context({ include: [], exclude: [] });
assert.lengthOf(result.include, 1);
assert.equal(result.include[0].actualNode, document.documentElement);
});
});
- describe('initiator', function() {
- it('should not be clobbered', function() {
+ describe('initiator', function () {
+ it('should not be clobbered', function () {
var result = new Context({
initiator: false
});
@@ -335,7 +335,7 @@ describe('Context', function() {
});
// document.hasOwnProperty is undefined in Firefox content scripts
- it('should not throw given really weird circumstances when hasOwnProperty is deleted from a document node?', function() {
+ it('should not throw given really weird circumstances when hasOwnProperty is deleted from a document node?', function () {
var spec = document.implementation.createHTMLDocument('ie is dumb');
spec.hasOwnProperty = undefined;
@@ -353,20 +353,20 @@ describe('Context', function() {
});
});
- describe('page', function() {
- it('takes the page argument as default', function() {
+ describe('page', function () {
+ it('takes the page argument as default', function () {
assert.isTrue(new Context({ page: true }).page);
assert.isFalse(new Context({ page: false }).page);
});
- it('is true if the document element is included', function() {
+ it('is true if the document element is included', function () {
assert.isTrue(new Context(document).page);
assert.isTrue(new Context(document.documentElement).page);
assert.isTrue(new Context('html').page);
assert.isTrue(new Context(':root').page);
});
- it('is true, with exclude used', function() {
+ it('is true, with exclude used', function () {
// What matters is that the documentElement is included
// not that parts within that are excluded
assert.isTrue(
@@ -377,7 +377,7 @@ describe('Context', function() {
);
});
- it('is false if the context does not include documentElement', function() {
+ it('is false if the context does not include documentElement', function () {
assert.isFalse(new Context(fixture).page);
assert.isFalse(new Context('#fixture').page);
assert.isFalse(new Context(['#fixture']).page);
@@ -385,20 +385,20 @@ describe('Context', function() {
});
});
- describe('focusable', function() {
- it('should default to true', function() {
+ describe('focusable', function () {
+ it('should default to true', function () {
var result = new Context();
assert.isTrue(result.focusable);
});
- it('should use passed in value', function() {
+ it('should use passed in value', function () {
var result = new Context({
focusable: false
});
assert.isFalse(result.focusable);
});
- it('should reject bad values', function() {
+ it('should reject bad values', function () {
var result = new Context({
focusable: 'hello'
});
@@ -406,13 +406,13 @@ describe('Context', function() {
});
});
- describe('size', function() {
- it('should default to empty object', function() {
+ describe('size', function () {
+ it('should default to empty object', function () {
var result = new Context();
assert.deepEqual(result.size, {});
});
- it('should use passed in value', function() {
+ it('should use passed in value', function () {
var result = new Context({
size: {
width: 10,
@@ -425,7 +425,7 @@ describe('Context', function() {
});
});
- it('should reject bad values', function() {
+ it('should reject bad values', function () {
var result = new Context({
size: 'hello'
});
@@ -433,10 +433,10 @@ describe('Context', function() {
});
});
- describe('frames', function() {
+ describe('frames', function () {
function iframeReady(src, context, id, cb, done) {
var iframe = document.createElement('iframe');
- iframe.addEventListener('load', function() {
+ iframe.addEventListener('load', function () {
try {
cb(iframe);
done();
@@ -449,13 +449,13 @@ describe('Context', function() {
context.appendChild(iframe);
}
- it('adds frames that are explicitly included', function(done) {
+ it('adds frames that are explicitly included', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context('#target');
assert.lengthOf(result.frames, 1);
assert.deepEqual(result.frames[0].node, $id('target'));
@@ -464,13 +464,13 @@ describe('Context', function() {
);
});
- it('adds frames that are implicitly included', function(done) {
+ it('adds frames that are implicitly included', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context('#outer');
assert.lengthOf(result.frames, 1);
assert.deepEqual(result.frames[0].node, $id('target'));
@@ -479,13 +479,13 @@ describe('Context', function() {
);
});
- it('sets include', function(done) {
+ it('sets include', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context([['#target', '#foo']]);
assert.lengthOf(result.frames, 1);
@@ -497,13 +497,13 @@ describe('Context', function() {
);
});
- it('sets exclude', function(done) {
+ it('sets exclude', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context({
exclude: [['#target', '#foo']]
});
@@ -517,12 +517,12 @@ describe('Context', function() {
);
});
- it('sets initiator: false', function(done) {
+ it('sets initiator: false', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function() {
+ function () {
var result = new Context();
assert.isTrue(result.initiator);
assert.lengthOf(result.frames, 1);
@@ -532,13 +532,13 @@ describe('Context', function() {
);
});
- describe('.page', function() {
- it('is true if context includes the document element', function(done) {
+ describe('.page', function () {
+ it('is true if context includes the document element', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function() {
+ function () {
var result = new Context({
exclude: [['#mocha']]
});
@@ -549,12 +549,12 @@ describe('Context', function() {
);
});
- it("can be false, even if the frame's documentElement is included", function(done) {
+ it("can be false, even if the frame's documentElement is included", function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function() {
+ function () {
var result = new Context({
include: [['#fixture']]
});
@@ -566,13 +566,13 @@ describe('Context', function() {
});
});
- describe('.focusable', function() {
- it('is true if tabindex is 0', function(done) {
+ describe('.focusable', function () {
+ it('is true if tabindex is 0', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function(iframe) {
+ function (iframe) {
iframe.tabIndex = '0';
var result = new Context();
assert.lengthOf(result.frames, 1);
@@ -582,12 +582,12 @@ describe('Context', function() {
);
});
- it('is false if the context has a negative tabindex', function(done) {
+ it('is false if the context has a negative tabindex', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function(iframe) {
+ function (iframe) {
iframe.tabIndex = '-1';
var result = new Context('#fixture');
assert.lengthOf(result.frames, 1);
@@ -597,12 +597,12 @@ describe('Context', function() {
);
});
- it('is false if the parent context is not focusable', function(done) {
+ it('is false if the parent context is not focusable', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function() {
+ function () {
var result = new Context({
include: ['#fixture'],
focusable: false
@@ -615,13 +615,13 @@ describe('Context', function() {
});
});
- describe('.size', function() {
- it('sets width and height of the frame', function(done) {
+ describe('.size', function () {
+ it('sets width and height of the frame', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function(iframe) {
+ function (iframe) {
iframe.width = '100';
iframe.height = '200';
var result = new Context('#fixture');
@@ -633,12 +633,12 @@ describe('Context', function() {
);
});
- it('works with CSS width / height', function(done) {
+ it('works with CSS width / height', function (done) {
iframeReady(
'../mock/frames/context.html',
$id('fixture'),
'target',
- function(iframe) {
+ function (iframe) {
iframe.setAttribute('style', 'width: 100px; height: 200px');
var result = new Context('#fixture');
var size = result.frames[0].size;
@@ -650,13 +650,13 @@ describe('Context', function() {
});
});
- it('combines includes', function(done) {
+ it('combines includes', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context([
['#target', '#foo'],
['#target', '#bar']
@@ -671,13 +671,13 @@ describe('Context', function() {
);
});
- it('does not include the same frame twice', function(done) {
+ it('does not include the same frame twice', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var result = new Context([$id('target'), $id('target')]);
assert.lengthOf(result.frames, 1);
assert.deepEqual(result.frames[0].node, $id('target'));
@@ -686,13 +686,13 @@ describe('Context', function() {
);
});
- it('should filter out invisible frames', function(done) {
+ it('should filter out invisible frames', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
+ function () {
var frame = $id('target');
frame.setAttribute('hidden', 'hidden');
@@ -703,14 +703,14 @@ describe('Context', function() {
);
});
- it('should throw when frame could not be found', function(done) {
+ it('should throw when frame could not be found', function (done) {
fixture.innerHTML = '
';
iframeReady(
'../mock/frames/context.html',
$id('outer'),
'target',
- function() {
- assert.throws(function() {
+ function () {
+ assert.throws(function () {
var ctxt = new Context(['#notAFrame', '#foo']);
});
},
diff --git a/test/core/base/rule-result.js b/test/core/base/rule-result.js
index 1563ffe1b0..01a6c7efe3 100644
--- a/test/core/base/rule-result.js
+++ b/test/core/base/rule-result.js
@@ -1,16 +1,16 @@
-describe('RuleResult', function() {
+describe('RuleResult', function () {
'use strict';
var RuleResult = axe._thisWillBeDeletedDoNotUse.base.RuleResult;
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(RuleResult);
});
- it('should have an empty array for nodes', function() {
+ it('should have an empty array for nodes', function () {
assert.deepEqual(new RuleResult({ id: 'monkeys' }).nodes, []);
});
- it('should grab id from passed in rule', function() {
+ it('should grab id from passed in rule', function () {
var result = new RuleResult({ id: 'monkeys' });
assert.equal(result.id, 'monkeys');
});
diff --git a/test/core/base/virtual-node/abstract-virtual-node.js b/test/core/base/virtual-node/abstract-virtual-node.js
index c803fb52f1..a1d720840f 100644
--- a/test/core/base/virtual-node/abstract-virtual-node.js
+++ b/test/core/base/virtual-node/abstract-virtual-node.js
@@ -1,9 +1,9 @@
-describe('AbstractVirtualNode', function() {
- it('should be a function', function() {
+describe('AbstractVirtualNode', function () {
+ it('should be a function', function () {
assert.isFunction(axe.AbstractVirtualNode);
});
- it('should throw an error when accessing props', function() {
+ it('should throw an error when accessing props', function () {
function fn() {
var abstractNode = new axe.AbstractVirtualNode();
if (abstractNode.props.nodeType === 1) {
@@ -14,7 +14,7 @@ describe('AbstractVirtualNode', function() {
assert.throws(fn);
});
- it('should throw an error when accessing attrNames', function() {
+ it('should throw an error when accessing attrNames', function () {
function fn() {
var abstractNode = new axe.AbstractVirtualNode();
return abstractNode.attrNames;
@@ -23,7 +23,7 @@ describe('AbstractVirtualNode', function() {
assert.throws(fn, 'VirtualNode class must have an "attrNames" property');
});
- it('should throw an error when accessing hasClass', function() {
+ it('should throw an error when accessing hasClass', function () {
function fn() {
var abstractNode = new axe.AbstractVirtualNode();
if (abstractNode.hasClass('foo')) {
@@ -34,7 +34,7 @@ describe('AbstractVirtualNode', function() {
assert.throws(fn);
});
- it('should throw an error when accessing attr', function() {
+ it('should throw an error when accessing attr', function () {
function fn() {
var abstractNode = new axe.AbstractVirtualNode();
if (abstractNode.attr('foo') === 'bar') {
@@ -45,7 +45,7 @@ describe('AbstractVirtualNode', function() {
assert.throws(fn);
});
- it('should throw an error when accessing hasAttr', function() {
+ it('should throw an error when accessing hasAttr', function () {
function fn() {
var abstractNode = new axe.AbstractVirtualNode();
if (abstractNode.hasAttr('foo')) {
@@ -56,19 +56,19 @@ describe('AbstractVirtualNode', function() {
assert.throws(fn);
});
- describe('hasClass, when attr is set', function() {
- it('should return true when the element has the class', function() {
+ describe('hasClass, when attr is set', function () {
+ it('should return true when the element has the class', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return 'my-class';
};
assert.isTrue(vNode.hasClass('my-class'));
});
- it('should return true when the element contains more than one class', function() {
+ it('should return true when the element contains more than one class', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return 'my-class a11y-focus visually-hidden';
};
@@ -77,35 +77,35 @@ describe('AbstractVirtualNode', function() {
assert.isTrue(vNode.hasClass('visually-hidden'));
});
- it('should return false when the element does not contain the class', function() {
+ it('should return false when the element does not contain the class', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return undefined;
};
assert.isFalse(vNode.hasClass('my-class'));
});
- it('should return false when the element contains only part of the class', function() {
+ it('should return false when the element contains only part of the class', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return 'my-class';
};
assert.isFalse(vNode.hasClass('class'));
});
- it('should return false if className is not of type string', function() {
+ it('should return false if className is not of type string', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return null;
};
assert.isFalse(vNode.hasClass('my-class'));
});
- it('should return true for whitespace characters', function() {
+ it('should return true for whitespace characters', function () {
var vNode = new axe.AbstractVirtualNode();
- vNode.attr = function() {
+ vNode.attr = function () {
return 'my-class\ta11y-focus\rvisually-hidden\ngrid\fcontainer';
};
diff --git a/test/core/base/virtual-node/serial-virtual-node.js b/test/core/base/virtual-node/serial-virtual-node.js
index 80ad4e0f7f..04e0f9af16 100644
--- a/test/core/base/virtual-node/serial-virtual-node.js
+++ b/test/core/base/virtual-node/serial-virtual-node.js
@@ -1,15 +1,15 @@
-describe('SerialVirtualNode', function() {
+describe('SerialVirtualNode', function () {
var SerialVirtualNode = axe.SerialVirtualNode;
- it('extends AbstractVirtualNode', function() {
+ it('extends AbstractVirtualNode', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div'
});
assert.instanceOf(vNode, axe.AbstractVirtualNode);
});
- describe('props', function() {
- it('assigns any properties to .props', function() {
+ describe('props', function () {
+ it('assigns any properties to .props', function () {
var props = {
nodeType: 1,
nodeName: 'div',
@@ -20,12 +20,12 @@ describe('SerialVirtualNode', function() {
assert.deepEqual(vNode.props, props);
});
- it('returns a frozen object', function() {
+ it('returns a frozen object', function () {
var vNode = new SerialVirtualNode({ nodeName: 'div' });
assert.isTrue(Object.isFrozen(vNode.props), 'Expect object to be frozen');
});
- it('takes 1 as its nodeType', function() {
+ it('takes 1 as its nodeType', function () {
var vNode = new SerialVirtualNode({
nodeType: 1,
nodeName: 'div'
@@ -33,7 +33,7 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode.props.nodeType, 1);
});
- it('takes 3 as its nodeType', function() {
+ it('takes 3 as its nodeType', function () {
var vNode = new SerialVirtualNode({
nodeType: 3,
nodeName: '#text'
@@ -41,14 +41,14 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode.props.nodeType, 3);
});
- it('has a default nodeType of 1', function() {
+ it('has a default nodeType of 1', function () {
var vNode = new SerialVirtualNode({ nodeName: 'div' });
assert.equal(vNode.props.nodeType, 1);
});
- it('does not throw if nodeType is falsy', function() {
- [null, undefined].forEach(function(nonThrowingNodeType) {
- assert.doesNotThrow(function() {
+ it('does not throw if nodeType is falsy', function () {
+ [null, undefined].forEach(function (nonThrowingNodeType) {
+ assert.doesNotThrow(function () {
// eslint-disable-next-line no-new
new SerialVirtualNode({
nodeType: nonThrowingNodeType,
@@ -58,9 +58,9 @@ describe('SerialVirtualNode', function() {
});
});
- it('throws if nodeType is a not a number', function() {
- [true, 'one', '1', { foo: 'bar' }].forEach(function(throwingNodeType) {
- assert.throws(function() {
+ it('throws if nodeType is a not a number', function () {
+ [true, 'one', '1', { foo: 'bar' }].forEach(function (throwingNodeType) {
+ assert.throws(function () {
// eslint-disable-next-line no-new
new SerialVirtualNode({
nodeType: throwingNodeType,
@@ -70,7 +70,7 @@ describe('SerialVirtualNode', function() {
});
});
- it('converts nodeNames to lower case', function() {
+ it('converts nodeNames to lower case', function () {
var htmlNodes = [
'DIV',
'SPAN',
@@ -81,13 +81,13 @@ describe('SerialVirtualNode', function() {
'BUTTON',
'Foo'
];
- htmlNodes.forEach(function(nodeName) {
+ htmlNodes.forEach(function (nodeName) {
var vNode = new SerialVirtualNode({ nodeName: nodeName });
assert.equal(vNode.props.nodeName, nodeName.toLowerCase());
});
});
- it('defaults to the correct nodeType for certain nodeNames', function() {
+ it('defaults to the correct nodeType for certain nodeNames', function () {
var vNode1 = new SerialVirtualNode({ nodeName: 'DIV' });
assert.equal(vNode1.props.nodeType, 1);
var vNode2 = new SerialVirtualNode({ nodeName: '#cdata-section' });
@@ -102,7 +102,7 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode11.props.nodeType, 11);
});
- it('defaults to the correct nodeName for certain nodeTypes', function() {
+ it('defaults to the correct nodeName for certain nodeTypes', function () {
var vNode2 = new SerialVirtualNode({ nodeType: 2 });
assert.equal(vNode2.props.nodeName, '#cdata-section');
var vNode3 = new SerialVirtualNode({ nodeType: 3 });
@@ -115,16 +115,16 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode11.props.nodeName, '#document-fragment');
});
- it('throws if nodeName is not a string', function() {
- [123, true, null, {}, undefined, []].forEach(function(notAString) {
- assert.throws(function() {
+ it('throws if nodeName is not a string', function () {
+ [123, true, null, {}, undefined, []].forEach(function (notAString) {
+ assert.throws(function () {
// eslint-disable-next-line no-new
new SerialVirtualNode({ nodeName: notAString });
});
});
});
- it('ignores the `attributes` property', function() {
+ it('ignores the `attributes` property', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: {
@@ -136,9 +136,9 @@ describe('SerialVirtualNode', function() {
assert.isUndefined(vNode.props.attributes);
});
- it('converts type prop to lower case', function() {
+ it('converts type prop to lower case', function () {
var types = ['text', 'COLOR', 'Month', 'uRL'];
- types.forEach(function(type) {
+ types.forEach(function (type) {
var vNode = new SerialVirtualNode({
nodeName: 'input',
type: type
@@ -147,9 +147,9 @@ describe('SerialVirtualNode', function() {
});
});
- it('converts type attribute to lower case', function() {
+ it('converts type attribute to lower case', function () {
var types = ['text', 'COLOR', 'Month', 'uRL'];
- types.forEach(function(type) {
+ types.forEach(function (type) {
var vNode = new SerialVirtualNode({
nodeName: 'input',
attributes: {
@@ -160,14 +160,14 @@ describe('SerialVirtualNode', function() {
});
});
- it('defaults type prop to "text"', function() {
+ it('defaults type prop to "text"', function () {
var vNode = new SerialVirtualNode({
nodeName: 'input'
});
assert.equal(vNode.props.type, 'text');
});
- it('default type prop to "text" if type is invalid', function() {
+ it('default type prop to "text" if type is invalid', function () {
var vNode = new SerialVirtualNode({
nodeName: 'input',
attributes: {
@@ -177,7 +177,7 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode.props.type, 'text');
});
- it('uses the type property over the type attribute', function() {
+ it('uses the type property over the type attribute', function () {
var vNode = new SerialVirtualNode({
nodeName: 'input',
type: 'month',
@@ -189,8 +189,8 @@ describe('SerialVirtualNode', function() {
});
});
- describe('attr', function() {
- it('returns a string value for the attribute', function() {
+ describe('attr', function () {
+ it('returns a string value for the attribute', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: {
@@ -206,7 +206,7 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode.attr('qux'), '');
});
- it('returns null if the attribute is null', function() {
+ it('returns null if the attribute is null', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: { foo: null }
@@ -214,16 +214,16 @@ describe('SerialVirtualNode', function() {
assert.isNull(vNode.attr('foo'));
});
- it('returns null if the attribute is not set', function() {
+ it('returns null if the attribute is not set', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div'
});
assert.isNull(vNode.attr('foo'));
});
- it('throws if the value is an object (for except null)', function() {
- [{}, [], /foo/].forEach(function(someObject) {
- assert.throws(function() {
+ it('throws if the value is an object (for except null)', function () {
+ [{}, [], /foo/].forEach(function (someObject) {
+ assert.throws(function () {
// eslint-disable-next-line no-new
new SerialVirtualNode({
nodeName: 'div',
@@ -233,7 +233,7 @@ describe('SerialVirtualNode', function() {
});
});
- it('converts `className` to `class`', function() {
+ it('converts `className` to `class`', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: {
@@ -243,7 +243,7 @@ describe('SerialVirtualNode', function() {
assert.equal(vNode.attr('class'), 'foo bar baz');
});
- it('converts `htmlFor` to `for`', function() {
+ it('converts `htmlFor` to `for`', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: {
@@ -254,8 +254,8 @@ describe('SerialVirtualNode', function() {
});
});
- describe('hasAttr', function() {
- it('returns true if the attribute has a value', function() {
+ describe('hasAttr', function () {
+ it('returns true if the attribute has a value', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: {
@@ -269,7 +269,7 @@ describe('SerialVirtualNode', function() {
assert.isTrue(vNode.hasAttr('baz'));
});
- it('returns true if the attribute is null', function() {
+ it('returns true if the attribute is null', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: { foo: null }
@@ -277,7 +277,7 @@ describe('SerialVirtualNode', function() {
assert.isTrue(vNode.hasAttr('foo'));
});
- it('returns false if the attribute is undefined', function() {
+ it('returns false if the attribute is undefined', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: { foo: undefined }
@@ -286,7 +286,7 @@ describe('SerialVirtualNode', function() {
assert.isFalse(vNode.hasAttr('bar'));
});
- it('converts `htmlFor` to `for`', function() {
+ it('converts `htmlFor` to `for`', function () {
var nodeWithoutFor = new SerialVirtualNode({
nodeName: 'div',
attributes: {}
@@ -300,7 +300,7 @@ describe('SerialVirtualNode', function() {
assert.isTrue(nodeWithFor.hasAttr('for'));
});
- it('converts `className` to `class`', function() {
+ it('converts `className` to `class`', function () {
var nodeWithoutClass = new SerialVirtualNode({
nodeName: 'div',
attributes: {}
@@ -315,8 +315,8 @@ describe('SerialVirtualNode', function() {
});
});
- describe('attrNames', function() {
- it('should return a list of attribute names', function() {
+ describe('attrNames', function () {
+ it('should return a list of attribute names', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div',
attributes: { foo: 'bar' }
@@ -325,7 +325,7 @@ describe('SerialVirtualNode', function() {
assert.deepEqual(vNode.attrNames, ['foo']);
});
- it('should return an empty array if there are no attributes', function() {
+ it('should return an empty array if there are no attributes', function () {
var vNode = new SerialVirtualNode({
nodeName: 'div'
});
diff --git a/test/core/base/virtual-node/virtual-node.js b/test/core/base/virtual-node/virtual-node.js
index 976035e942..5206df3e2f 100644
--- a/test/core/base/virtual-node/virtual-node.js
+++ b/test/core/base/virtual-node/virtual-node.js
@@ -1,23 +1,23 @@
-describe('VirtualNode', function() {
+describe('VirtualNode', function () {
'use strict';
var VirtualNode = axe.VirtualNode;
var node;
- beforeEach(function() {
+ beforeEach(function () {
node = document.createElement('div');
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(VirtualNode);
});
- it('should accept three parameters', function() {
+ it('should accept three parameters', function () {
assert.lengthOf(VirtualNode, 3);
});
- describe('prototype', function() {
- it('should have public properties', function() {
+ describe('prototype', function () {
+ it('should have public properties', function () {
var parent = {};
var vNode = new VirtualNode(node, parent, 'foo');
@@ -27,7 +27,7 @@ describe('VirtualNode', function() {
assert.equal(vNode.parent, parent);
});
- it('should abstract Node properties', function() {
+ it('should abstract Node properties', function () {
node = document.createElement('input');
node.id = 'monkeys';
var vNode = new VirtualNode(node);
@@ -39,7 +39,7 @@ describe('VirtualNode', function() {
assert.equal(vNode.props.type, 'text');
});
- it('should reflect selected property', function() {
+ it('should reflect selected property', function () {
node = document.createElement('option');
var vNode = new VirtualNode(node);
assert.equal(vNode.props.selected, false);
@@ -49,7 +49,7 @@ describe('VirtualNode', function() {
assert.equal(vNode.props.selected, true);
});
- it('should lowercase type', function() {
+ it('should lowercase type', function () {
var node = document.createElement('input');
node.setAttribute('type', 'COLOR');
var vNode = new VirtualNode(node);
@@ -57,14 +57,14 @@ describe('VirtualNode', function() {
assert.equal(vNode.props.type, 'color');
});
- it('should default type to text', function() {
+ it('should default type to text', function () {
var node = document.createElement('input');
var vNode = new VirtualNode(node);
assert.equal(vNode.props.type, 'text');
});
- it('should default type to text if type is invalid', function() {
+ it('should default type to text if type is invalid', function () {
var node = document.createElement('input');
node.setAttribute('type', 'woohoo');
var vNode = new VirtualNode(node);
@@ -72,7 +72,7 @@ describe('VirtualNode', function() {
assert.equal(vNode.props.type, 'text');
});
- it('should lowercase nodeName', function() {
+ it('should lowercase nodeName', function () {
var node = {
nodeName: 'FOOBAR'
};
@@ -81,22 +81,22 @@ describe('VirtualNode', function() {
assert.equal(vNode.props.nodeName, 'foobar');
});
- describe('attr', function() {
- it('should return the value of the given attribute', function() {
+ describe('attr', function () {
+ it('should return the value of the given attribute', function () {
node.setAttribute('data-foo', 'bar');
var vNode = new VirtualNode(node);
assert.equal(vNode.attr('data-foo'), 'bar');
});
- it('should return null for text nodes', function() {
+ it('should return null for text nodes', function () {
node.textContent = 'hello';
var vNode = new VirtualNode(node.firstChild);
assert.isNull(vNode.attr('data-foo'));
});
- it('should return null if getAttribute is not a function', function() {
+ it('should return null if getAttribute is not a function', function () {
var node = {
nodeName: 'DIV',
getAttribute: null
@@ -107,28 +107,28 @@ describe('VirtualNode', function() {
});
});
- describe('hasAttr', function() {
- it('should return true if the element has the attribute', function() {
+ describe('hasAttr', function () {
+ it('should return true if the element has the attribute', function () {
node.setAttribute('foo', 'bar');
var vNode = new VirtualNode(node);
assert.isTrue(vNode.hasAttr('foo'));
});
- it('should return false if the element does not have the attribute', function() {
+ it('should return false if the element does not have the attribute', function () {
var vNode = new VirtualNode(node);
assert.isFalse(vNode.hasAttr('foo'));
});
- it('should return false for text nodes', function() {
+ it('should return false for text nodes', function () {
node.textContent = 'hello';
var vNode = new VirtualNode(node.firstChild);
assert.isFalse(vNode.hasAttr('foo'));
});
- it('should return false if hasAttribute is not a function', function() {
+ it('should return false if hasAttribute is not a function', function () {
var node = {
nodeName: 'DIV',
hasAttribute: null
@@ -139,15 +139,15 @@ describe('VirtualNode', function() {
});
});
- describe('attrNames', function() {
- it('should return a list of attribute names', function() {
+ describe('attrNames', function () {
+ it('should return a list of attribute names', function () {
node.setAttribute('foo', 'bar');
var vNode = new VirtualNode(node);
assert.deepEqual(vNode.attrNames, ['foo']);
});
- it('should work with clobbered attributes', function() {
+ it('should work with clobbered attributes', function () {
var node = document.createElement('form');
node.setAttribute('id', '123');
node.innerHTML = ' ';
@@ -156,14 +156,14 @@ describe('VirtualNode', function() {
assert.deepEqual(vNode.attrNames, ['id']);
});
- it('should return an empty array if there are no attributes', function() {
+ it('should return an empty array if there are no attributes', function () {
var vNode = new VirtualNode(node);
assert.deepEqual(vNode.attrNames, []);
});
});
- describe('nodeIndex', function() {
- it('increments nodeIndex when a parent is passed', function() {
+ describe('nodeIndex', function () {
+ it('increments nodeIndex when a parent is passed', function () {
var vHtml = new VirtualNode({ nodeName: 'html' });
var vHead = new VirtualNode({ nodeName: 'head' }, vHtml);
var vTitle = new VirtualNode({ nodeName: 'title' }, vHead);
@@ -175,7 +175,7 @@ describe('VirtualNode', function() {
assert.equal(vBody.nodeIndex, 3);
});
- it('resets nodeIndex when no parent is passed', function() {
+ it('resets nodeIndex when no parent is passed', function () {
var vHtml = new VirtualNode({ nodeName: 'html' });
var vHead = new VirtualNode({ nodeName: 'head' }, vHtml);
assert.equal(vHtml.nodeIndex, 0);
@@ -188,22 +188,22 @@ describe('VirtualNode', function() {
});
});
- describe.skip('isFocusable', function() {
+ describe.skip('isFocusable', function () {
var commons;
- beforeEach(function() {
+ beforeEach(function () {
commons = axe.commons = axe.commons;
});
- afterEach(function() {
+ afterEach(function () {
axe.commons = commons;
});
- it('should call dom.isFocusable', function() {
+ it('should call dom.isFocusable', function () {
var called = false;
axe.commons = {
dom: {
- isFocusable: function() {
+ isFocusable: function () {
called = true;
}
}
@@ -214,11 +214,11 @@ describe('VirtualNode', function() {
assert.isTrue(called);
});
- it('should only call dom.isFocusable once', function() {
+ it('should only call dom.isFocusable once', function () {
var count = 0;
axe.commons = {
dom: {
- isFocusable: function() {
+ isFocusable: function () {
count++;
}
}
@@ -231,22 +231,22 @@ describe('VirtualNode', function() {
});
});
- describe.skip('tabbableElements', function() {
+ describe.skip('tabbableElements', function () {
var commons;
- beforeEach(function() {
+ beforeEach(function () {
commons = axe.commons = axe.commons;
});
- afterEach(function() {
+ afterEach(function () {
axe.commons = commons;
});
- it('should call dom.getTabbableElements', function() {
+ it('should call dom.getTabbableElements', function () {
var called = false;
axe.commons = {
dom: {
- getTabbableElements: function() {
+ getTabbableElements: function () {
called = true;
}
}
@@ -257,11 +257,11 @@ describe('VirtualNode', function() {
assert.isTrue(called);
});
- it('should only call dom.getTabbableElements once', function() {
+ it('should only call dom.getTabbableElements once', function () {
var count = 0;
axe.commons = {
dom: {
- getTabbableElements: function() {
+ getTabbableElements: function () {
count++;
}
}
@@ -274,23 +274,23 @@ describe('VirtualNode', function() {
});
});
- describe('getComputedStylePropertyValue', function() {
+ describe('getComputedStylePropertyValue', function () {
var computedStyle;
- beforeEach(function() {
+ beforeEach(function () {
computedStyle = window.getComputedStyle;
});
- afterEach(function() {
+ afterEach(function () {
window.getComputedStyle = computedStyle;
});
- it('should call window.getComputedStyle and return the property', function() {
+ it('should call window.getComputedStyle and return the property', function () {
var called = false;
- window.getComputedStyle = function() {
+ window.getComputedStyle = function () {
called = true;
return {
- getPropertyValue: function() {
+ getPropertyValue: function () {
return 'result';
}
};
@@ -302,13 +302,13 @@ describe('VirtualNode', function() {
assert.equal(result, 'result');
});
- it('should only call window.getComputedStyle and getPropertyValue once', function() {
+ it('should only call window.getComputedStyle and getPropertyValue once', function () {
var computedCount = 0;
var propertyCount = 0;
- window.getComputedStyle = function() {
+ window.getComputedStyle = function () {
computedCount++;
return {
- getPropertyValue: function() {
+ getPropertyValue: function () {
propertyCount++;
}
};
@@ -322,10 +322,10 @@ describe('VirtualNode', function() {
});
});
- describe('clientRects', function() {
- it('should call node.getClientRects', function() {
+ describe('clientRects', function () {
+ it('should call node.getClientRects', function () {
var called = false;
- node.getClientRects = function() {
+ node.getClientRects = function () {
called = true;
return [];
};
@@ -335,9 +335,9 @@ describe('VirtualNode', function() {
assert.isTrue(called);
});
- it('should only call node.getClientRects once', function() {
+ it('should only call node.getClientRects once', function () {
var count = 0;
- node.getClientRects = function() {
+ node.getClientRects = function () {
count++;
return [];
};
@@ -348,8 +348,8 @@ describe('VirtualNode', function() {
assert.equal(count, 1);
});
- it('should filter out 0 width rects', function() {
- node.getClientRects = function() {
+ it('should filter out 0 width rects', function () {
+ node.getClientRects = function () {
return [{ width: 10 }, { width: 0 }, { width: 20 }];
};
var vNode = new VirtualNode(node);
@@ -358,10 +358,10 @@ describe('VirtualNode', function() {
});
});
- describe('boundingClientRect', function() {
- it('should call node.getBoundingClientRect', function() {
+ describe('boundingClientRect', function () {
+ it('should call node.getBoundingClientRect', function () {
var called = false;
- node.getBoundingClientRect = function() {
+ node.getBoundingClientRect = function () {
called = true;
};
var vNode = new VirtualNode(node);
@@ -370,9 +370,9 @@ describe('VirtualNode', function() {
assert.isTrue(called);
});
- it('should only call node.getBoundingClientRect once', function() {
+ it('should only call node.getBoundingClientRect once', function () {
var count = 0;
- node.getBoundingClientRect = function() {
+ node.getBoundingClientRect = function () {
count++;
};
var vNode = new VirtualNode(node);
diff --git a/test/core/constants.js b/test/core/constants.js
index 09cfbfaeb2..6b66637723 100644
--- a/test/core/constants.js
+++ b/test/core/constants.js
@@ -1,35 +1,35 @@
-describe('axe.constants', function() {
+describe('axe.constants', function () {
'use strict';
- it('should create an object', function() {
+ it('should create an object', function () {
assert.isObject(axe.constants);
});
- it('should have a results array', function() {
+ it('should have a results array', function () {
assert.isArray(axe.constants.results);
});
- it('should have PASS', function() {
+ it('should have PASS', function () {
assert.equal(axe.constants.PASS, 'passed');
});
- it('should have FAIL', function() {
+ it('should have FAIL', function () {
assert.equal(axe.constants.FAIL, 'failed');
});
- it('should have NA', function() {
+ it('should have NA', function () {
assert.equal(axe.constants.NA, 'inapplicable');
});
- it('should have CANTTELL', function() {
+ it('should have CANTTELL', function () {
assert.equal(axe.constants.CANTTELL, 'cantTell');
});
- it('should have priorities for results', function() {
+ it('should have priorities for results', function () {
assert.equal(axe.constants.NA_PRIO, 0);
});
- it('should have groups for results', function() {
+ it('should have groups for results', function () {
assert.equal(axe.constants.FAIL_GROUP, 'violations');
});
});
diff --git a/test/core/export.js b/test/core/export.js
index df147d1f0c..4091a872bc 100644
--- a/test/core/export.js
+++ b/test/core/export.js
@@ -1,10 +1,10 @@
-describe('export', function() {
+describe('export', function () {
'use strict';
- it('should publish a global `axe` variable', function() {
+ it('should publish a global `axe` variable', function () {
assert.isDefined(window.axe);
});
- it('should define version', function() {
+ it('should define version', function () {
assert.isNotNull(axe.version);
});
});
diff --git a/test/core/index.js b/test/core/index.js
index 03bce64000..c7355d4ea7 100644
--- a/test/core/index.js
+++ b/test/core/index.js
@@ -1,10 +1,10 @@
-describe('index', function() {
+describe('index', function () {
'use strict';
- it('should redefine `define`', function() {
+ it('should redefine `define`', function () {
assert.equal(typeof define, 'undefined');
});
- it('should redefine `require`', function() {
+ it('should redefine `require`', function () {
assert.equal(typeof require, 'undefined');
});
});
diff --git a/test/core/log.js b/test/core/log.js
index 31e92fe6fb..a3d4c2004c 100644
--- a/test/core/log.js
+++ b/test/core/log.js
@@ -1,18 +1,18 @@
-describe('axe.log', function() {
+describe('axe.log', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.log);
});
- it('should invoke console.log', function() {
+ it('should invoke console.log', function () {
var orig = window.console;
if (!window.console || window.console.log) {
- window.console = { log: function() {} };
+ window.console = { log: function () {} };
}
var expected = ['hi', 'hello'];
var success = false;
- window.console.log = function() {
+ window.console.log = function () {
success = true;
assert.equal(arguments[0], expected[0]);
assert.equal(arguments[1], expected[1]);
diff --git a/test/core/public/cleanup.js b/test/core/public/cleanup.js
index dc4c348b1a..d6e6d373e7 100644
--- a/test/core/public/cleanup.js
+++ b/test/core/public/cleanup.js
@@ -1,12 +1,12 @@
/*global cleanup */
-describe('cleanup', function() {
+describe('cleanup', function () {
'use strict';
function createFrames(callback) {
var frame;
frame = document.createElement('iframe');
frame.src = '../mock/frames/test.html';
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
setTimeout(callback, 500);
});
fixture.appendChild(frame);
@@ -14,22 +14,22 @@ describe('cleanup', function() {
var fixture = document.getElementById('fixture');
- var assertNotCalled = function() {
+ var assertNotCalled = function () {
assert.ok(false, 'Should not be called');
};
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe.plugins = {};
});
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = null;
});
- it('should throw if no audit is configured', function() {
+ it('should throw if no audit is configured', function () {
assert.throws(
- function() {
+ function () {
axe.cleanup(document, {});
},
Error,
@@ -37,7 +37,7 @@ describe('cleanup', function() {
);
});
- it('should call cleanup on all plugins', function(done) {
+ it('should call cleanup on all plugins', function (done) {
/*eslint no-unused-vars: 0*/
var cleaned = false;
axe._load({
@@ -45,52 +45,52 @@ describe('cleanup', function() {
});
axe.registerPlugin({
id: 'p',
- run: function() {},
- add: function(impl) {
+ run: function () {},
+ add: function (impl) {
this._registry[impl.id] = impl;
},
commands: []
});
- axe.plugins.p.cleanup = function(res) {
+ axe.plugins.p.cleanup = function (res) {
cleaned = true;
res();
};
- axe.cleanup(function() {
+ axe.cleanup(function () {
assert.equal(cleaned, true);
done();
}, assertNotCalled);
});
- it('should not throw exception if no arguments are provided', function(done) {
+ it('should not throw exception if no arguments are provided', function (done) {
var cleaned = false;
axe._load({
rules: []
});
axe.registerPlugin({
id: 'p',
- run: function() {},
- add: function(impl) {
+ run: function () {},
+ add: function (impl) {
this._registry[impl.id] = impl;
},
commands: []
});
- axe.plugins.p.cleanup = function(res) {
+ axe.plugins.p.cleanup = function (res) {
cleaned = true;
res();
};
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
axe.cleanup();
done();
});
});
- it('should send command to frames to cleanup', function(done) {
- createFrames(function() {
+ it('should send command to frames to cleanup', function (done) {
+ createFrames(function () {
axe._load({});
var frame = fixture.querySelector('iframe');
var win = frame.contentWindow;
- win.addEventListener('message', function(message) {
+ win.addEventListener('message', function (message) {
var data = JSON.parse(message.data);
if (data.topic === 'axe.start') {
assert.deepEqual(data.payload, { command: 'cleanup-plugin' });
diff --git a/test/core/public/configure.js b/test/core/public/configure.js
index e8cc5742c5..12972a0aeb 100644
--- a/test/core/public/configure.js
+++ b/test/core/public/configure.js
@@ -1,4 +1,4 @@
-describe('axe.configure', function() {
+describe('axe.configure', function () {
'use strict';
// var Rule = axe._thisWillBeDeletedDoNotUse.base.Rule;
// var Check = axe._thisWillBeDeletedDoNotUse.base.Check;
@@ -6,18 +6,18 @@ describe('axe.configure', function() {
var axeVersion = axe.version;
var ver = axe.version.substring(0, axe.version.lastIndexOf('.'));
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe.version = axeVersion;
});
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = null;
});
- it('should throw if audit is not configured', function() {
+ it('should throw if audit is not configured', function () {
assert.throws(
- function() {
+ function () {
axe.configure({});
},
Error,
@@ -25,7 +25,7 @@ describe('axe.configure', function() {
);
});
- it("should override an audit's reporter - string", function() {
+ it("should override an audit's reporter - string", function () {
axe._load({});
assert.isNull(axe._audit.reporter);
@@ -33,13 +33,13 @@ describe('axe.configure', function() {
assert.equal(axe._audit.reporter, 'v1');
});
- it('should not allow setting to an un-registered reporter', function() {
+ it('should not allow setting to an un-registered reporter', function () {
axe._load({ reporter: 'v1' });
axe.configure({ reporter: 'no-exist-evar-plz' });
assert.equal(axe._audit.reporter, 'v1');
});
- it('should allow for addition of rules', function() {
+ it('should allow for addition of rules', function () {
axe._load({});
axe.configure({
rules: [
@@ -59,31 +59,31 @@ describe('axe.configure', function() {
assert.deepEqual(axe._audit.data.rules.bob.joe, 'joe');
});
- it('should throw error if rules property is invalid', function() {
- assert.throws(function() {
+ it('should throw error if rules property is invalid', function () {
+ assert.throws(function () {
axe.configure({ rules: 'hello' }),
TypeError,
/^Rules property must be an array/;
});
});
- it('should throw error if rule is invalid', function() {
- assert.throws(function() {
+ it('should throw error if rule is invalid', function () {
+ assert.throws(function () {
axe.configure({ rules: ['hello'] }),
TypeError,
/Configured rule "hello" is invalid/;
});
});
- it('should throw error if rule does not have an id', function() {
- assert.throws(function() {
+ it('should throw error if rule does not have an id', function () {
+ assert.throws(function () {
axe.configure({ rules: [{ foo: 'bar' }] }),
TypeError,
/Configured rule "{foo:\"bar\"}" is invalid/;
});
});
- it('should call setBranding when passed options', function() {
+ it('should call setBranding when passed options', function () {
axe._load({});
axe.configure({
rules: [
@@ -113,7 +113,7 @@ describe('axe.configure', function() {
);
});
- it('sets branding on newly configured rules', function() {
+ it('sets branding on newly configured rules', function () {
axe._load({});
axe.configure({
branding: {
@@ -138,7 +138,7 @@ describe('axe.configure', function() {
);
});
- it('should allow for overwriting of rules', function() {
+ it('should allow for overwriting of rules', function () {
axe._load({
data: {
rules: {
@@ -169,7 +169,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.data.rules.bob.joe, 'joe');
});
- it('should allow for the addition of checks', function() {
+ it('should allow for the addition of checks', function () {
axe._load({});
axe.configure({
checks: [
@@ -189,31 +189,31 @@ describe('axe.configure', function() {
assert.equal(axe._audit.data.checks.bob.joe, 'joe');
});
- it('should throw error if checks property is invalid', function() {
- assert.throws(function() {
+ it('should throw error if checks property is invalid', function () {
+ assert.throws(function () {
axe.configure({ checks: 'hello' }),
TypeError,
/^Checks property must be an array/;
});
});
- it('should throw error if check is invalid', function() {
- assert.throws(function() {
+ it('should throw error if check is invalid', function () {
+ assert.throws(function () {
axe.configure({ checks: ['hello'] }),
TypeError,
/Configured check "hello" is invalid/;
});
});
- it('should throw error if check does not have an id', function() {
- assert.throws(function() {
+ it('should throw error if check does not have an id', function () {
+ assert.throws(function () {
axe.configure({ checks: [{ foo: 'bar' }] }),
TypeError,
/Configured check "{foo:\"bar\"}" is invalid/;
});
});
- it('should allow for the overwriting of checks', function() {
+ it('should allow for the overwriting of checks', function () {
axe._load({
data: {
checks: {
@@ -245,7 +245,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.data.checks.bob.joe, 'joe');
});
- it('should create an execution context for check messages', function() {
+ it('should create an execution context for check messages', function () {
axe._load({});
axe.configure({
checks: [
@@ -267,7 +267,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.data.checks.bob.messages.fail, 'Bob Pete');
});
- it('overrides the default value of audit.tagExclude', function() {
+ it('overrides the default value of audit.tagExclude', function () {
axe._load({});
assert.deepEqual(axe._audit.tagExclude, ['experimental']);
@@ -277,7 +277,7 @@ describe('axe.configure', function() {
assert.deepEqual(axe._audit.tagExclude, ['ninjas']);
});
- it('disables all untouched rules with disableOtherRules', function() {
+ it('disables all untouched rules with disableOtherRules', function () {
axe._load({
rules: [{ id: 'captain-america' }, { id: 'thor' }, { id: 'spider-man' }]
});
@@ -297,7 +297,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.rules[3].enabled, true);
});
- it("should allow overriding an audit's noHtml", function() {
+ it("should allow overriding an audit's noHtml", function () {
axe._load({});
assert.isFalse(axe._audit.noHtml);
@@ -305,7 +305,7 @@ describe('axe.configure', function() {
assert.isTrue(axe._audit.noHtml);
});
- it("should allow overriding an audit's allowedOrigins", function() {
+ it("should allow overriding an audit's allowedOrigins", function () {
axe._load({});
assert.notDeepEqual(axe._audit.allowedOrigins, ['foo']);
@@ -313,22 +313,22 @@ describe('axe.configure', function() {
assert.deepEqual(axe._audit.allowedOrigins, ['foo']);
});
- it('should throw error if allowedOrigins is not an array', function() {
+ it('should throw error if allowedOrigins is not an array', function () {
axe._load({});
- assert.throws(function() {
+ assert.throws(function () {
axe.configure({ allowedOrigins: 'foo' });
});
});
- it("should throw error if the origin is '*'", function() {
+ it("should throw error if the origin is '*'", function () {
axe._load({});
- assert.throws(function() {
+ assert.throws(function () {
axe.configure({ allowedOrigins: ['foo', '*'] });
});
});
- describe('given a locale object', function() {
- beforeEach(function() {
+ describe('given a locale object', function () {
+ beforeEach(function () {
axe._load({});
axe.configure({
@@ -347,7 +347,7 @@ describe('axe.configure', function() {
checks: [
{
id: 'banana',
- evaluate: function() {},
+ evaluate: function () {},
metadata: {
impact: 'srsly serious',
messages: {
@@ -365,7 +365,7 @@ describe('axe.configure', function() {
});
});
- it('should update check and rule metadata', function() {
+ it('should update check and rule metadata', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -403,7 +403,7 @@ describe('axe.configure', function() {
});
});
- it('should merge locales (favoring "new")', function() {
+ it('should merge locales (favoring "new")', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -430,7 +430,7 @@ describe('axe.configure', function() {
});
});
- it('sets the lang property', function() {
+ it('sets the lang property', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -446,7 +446,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.lang, 'lol');
});
- it('should call doT.compile if a messages uses doT syntax', function() {
+ it('should call doT.compile if a messages uses doT syntax', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -467,7 +467,7 @@ describe('axe.configure', function() {
);
});
- it('should leave the messages as a string if it does not use doT syntax', function() {
+ it('should leave the messages as a string if it does not use doT syntax', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -486,22 +486,22 @@ describe('axe.configure', function() {
assert.isTrue(typeof localeData.checks.banana.messages.fail === 'string');
});
- it('should update failure messages', function() {
+ it('should update failure messages', function () {
axe._load({
data: {
failureSummaries: {
any: {
- failureMessage: function() {
+ failureMessage: function () {
return 'failed any';
}
},
none: {
- failureMessage: function() {
+ failureMessage: function () {
return 'failed none';
}
}
},
- incompleteFallbackMessage: function() {
+ incompleteFallbackMessage: function () {
return 'failed incomplete';
}
}
@@ -530,22 +530,22 @@ describe('axe.configure', function() {
assert.equal(localeData.incompleteFallbackMessage, 'baz');
});
- it('should merge failure messages', function() {
+ it('should merge failure messages', function () {
axe._load({
data: {
failureSummaries: {
any: {
- failureMessage: function() {
+ failureMessage: function () {
return 'failed any';
}
},
none: {
- failureMessage: function() {
+ failureMessage: function () {
return 'failed none';
}
}
},
- incompleteFallbackMessage: function() {
+ incompleteFallbackMessage: function () {
return 'failed incomplete';
}
}
@@ -573,12 +573,12 @@ describe('axe.configure', function() {
assert.equal(localeData.incompleteFallbackMessage(), 'failed incomplete');
});
- it('should not strip newline characters from doT template', function() {
+ it('should not strip newline characters from doT template', function () {
axe._load({
data: {
failureSummaries: {
any: {
- failureMessage: function() {
+ failureMessage: function () {
return 'failed any';
}
}
@@ -607,9 +607,9 @@ describe('axe.configure', function() {
);
});
- describe('only given checks', function() {
- it('should not error', function() {
- assert.doesNotThrow(function() {
+ describe('only given checks', function () {
+ it('should not error', function () {
+ assert.doesNotThrow(function () {
axe.configure({
locale: {
lang: 'lol',
@@ -627,9 +627,9 @@ describe('axe.configure', function() {
});
});
- describe('only given rules', function() {
- it('should not error', function() {
- assert.doesNotThrow(function() {
+ describe('only given rules', function () {
+ it('should not error', function () {
+ assert.doesNotThrow(function () {
axe.configure({
locale: {
rules: { greeting: { help: 'foo', description: 'bar' } }
@@ -639,13 +639,13 @@ describe('axe.configure', function() {
});
});
- describe('check incomplete messages', function() {
- beforeEach(function() {
+ describe('check incomplete messages', function () {
+ beforeEach(function () {
axe.configure({
checks: [
{
id: 'panda',
- evaluate: function() {},
+ evaluate: function () {},
metadata: {
impact: 'yep',
messages: {
@@ -659,7 +659,7 @@ describe('axe.configure', function() {
});
});
- it('should support strings', function() {
+ it('should support strings', function () {
axe.configure({
locale: {
checks: {
@@ -673,7 +673,7 @@ describe('axe.configure', function() {
assert.equal(axe._audit.data.checks.panda.messages.incomplete, 'radio');
});
- it('should shallow-merge objects', function() {
+ it('should shallow-merge objects', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -698,7 +698,7 @@ describe('axe.configure', function() {
// This test ensures we do not drop additional properties added to
// checks. See https://github.com/dequelabs/axe-core/pull/1036/files#r207738673
// for reasoning.
- it('should keep existing properties on check data', function() {
+ it('should keep existing properties on check data', function () {
axe.configure({
checks: [
{
@@ -733,8 +733,8 @@ describe('axe.configure', function() {
assert.equal(banana.messages.pass, 'yay banana');
});
- it('should error when provided an unknown rule id', function() {
- assert.throws(function() {
+ it('should error when provided an unknown rule id', function () {
+ assert.throws(function () {
axe.configure({
locale: {
rules: { nope: { help: 'helpme' } }
@@ -743,8 +743,8 @@ describe('axe.configure', function() {
}, /unknown rule: "nope"/);
});
- it('should error when provided an unknown check id', function() {
- assert.throws(function() {
+ it('should error when provided an unknown check id', function () {
+ assert.throws(function () {
axe.configure({
locale: {
checks: { nope: { pass: 'helpme' } }
@@ -753,8 +753,8 @@ describe('axe.configure', function() {
}, /unknown check: "nope"/);
});
- it('should error when provided an unknown failure summary', function() {
- assert.throws(function() {
+ it('should error when provided an unknown failure summary', function () {
+ assert.throws(function () {
axe.configure({
locale: {
failureSummaries: {
@@ -765,7 +765,7 @@ describe('axe.configure', function() {
});
});
- it('should set default locale', function() {
+ it('should set default locale', function () {
assert.isNull(axe._audit._defaultLocale);
axe.configure({
locale: {
@@ -780,8 +780,8 @@ describe('axe.configure', function() {
assert.ok(axe._audit._defaultLocale);
});
- describe('also given metadata', function() {
- it('should favor the locale', function() {
+ describe('also given metadata', function () {
+ it('should favor the locale', function () {
axe.configure({
locale: {
lang: 'lol',
@@ -808,9 +808,9 @@ describe('axe.configure', function() {
});
});
- describe('after locale has been set', function() {
- describe('the provided messages', function() {
- it('should allow for doT templating', function() {
+ describe('after locale has been set', function () {
+ describe('the provided messages', function () {
+ it('should allow for doT templating', function () {
axe.configure({
locale: {
lang: 'foo',
@@ -832,13 +832,13 @@ describe('axe.configure', function() {
});
});
- describe('given an axeVersion property', function() {
- beforeEach(function() {
+ describe('given an axeVersion property', function () {
+ beforeEach(function () {
axe._load({});
axe.version = '1.2.3';
});
- it('should not throw if version matches axe.version', function() {
+ it('should not throw if version matches axe.version', function () {
assert.doesNotThrow(function fn() {
axe.configure({
axeVersion: '1.2.3'
@@ -851,7 +851,7 @@ describe('axe.configure', function() {
});
});
- it('should not throw if patch version is less than axe.version', function() {
+ it('should not throw if patch version is less than axe.version', function () {
assert.doesNotThrow(function fn() {
axe.configure({
axeVersion: '1.2.0'
@@ -859,7 +859,7 @@ describe('axe.configure', function() {
});
});
- it('should not throw if minor version is less than axe.version', function() {
+ it('should not throw if minor version is less than axe.version', function () {
assert.doesNotThrow(function fn() {
axe.configure({
axeVersion: '1.1.9'
@@ -867,7 +867,7 @@ describe('axe.configure', function() {
});
});
- it('should not throw if versions match and axe has a canary version', function() {
+ it('should not throw if versions match and axe has a canary version', function () {
axe.version = '1.2.3-canary.2664bae';
assert.doesNotThrow(function fn() {
axe.configure({
@@ -876,7 +876,7 @@ describe('axe.configure', function() {
});
});
- it('should throw if invalid version', function() {
+ it('should throw if invalid version', function () {
assert.throws(function fn() {
axe.configure({
axeVersion: '2'
@@ -890,7 +890,7 @@ describe('axe.configure', function() {
}, 'Invalid configured version 2..');
});
- it('should throw if major version is different than axe.version', function() {
+ it('should throw if major version is different than axe.version', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -909,7 +909,7 @@ describe('axe.configure', function() {
});
});
- it('should throw if minor version is greater than axe.version', function() {
+ it('should throw if minor version is greater than axe.version', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -920,7 +920,7 @@ describe('axe.configure', function() {
});
});
- it('should throw if patch version is greater than axe.version', function() {
+ it('should throw if patch version is greater than axe.version', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -931,7 +931,7 @@ describe('axe.configure', function() {
});
});
- it('should throw if versions match and axeVersion has a canary version', function() {
+ it('should throw if versions match and axeVersion has a canary version', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -942,7 +942,7 @@ describe('axe.configure', function() {
});
});
- it('should throw if versions match and both have a canary version', function() {
+ it('should throw if versions match and both have a canary version', function () {
axe.version = '1.2.3-canary.2664bae';
assert.throws(function fn() {
axe.configure(
@@ -954,7 +954,7 @@ describe('axe.configure', function() {
});
});
- it('should accept ver property as fallback', function() {
+ it('should accept ver property as fallback', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -965,7 +965,7 @@ describe('axe.configure', function() {
});
});
- it('should accept axeVersion over ver property', function() {
+ it('should accept axeVersion over ver property', function () {
assert.throws(function fn() {
axe.configure(
{
@@ -978,13 +978,13 @@ describe('axe.configure', function() {
});
});
- describe('given a standards object', function() {
- beforeEach(function() {
+ describe('given a standards object', function () {
+ beforeEach(function () {
axe._load({});
});
- describe('ariaAttrs', function() {
- it('should allow creating new attr', function() {
+ describe('ariaAttrs', function () {
+ it('should allow creating new attr', function () {
axe.configure({
standards: {
ariaAttrs: {
@@ -999,7 +999,7 @@ describe('axe.configure', function() {
assert.equal(ariaAttr.type, 'string');
});
- it('should override existing attr', function() {
+ it('should override existing attr', function () {
axe.configure({
standards: {
ariaAttrs: {
@@ -1026,7 +1026,7 @@ describe('axe.configure', function() {
assert.deepEqual(ariaAttr.values, ['foo', 'bar']);
});
- it('should merge existing attr', function() {
+ it('should merge existing attr', function () {
axe.configure({
standards: {
ariaAttrs: {
@@ -1053,7 +1053,7 @@ describe('axe.configure', function() {
assert.deepEqual(ariaAttr.values, ['foo', 'bar']);
});
- it('should override and not merge array', function() {
+ it('should override and not merge array', function () {
axe.configure({
standards: {
ariaAttrs: {
diff --git a/test/core/public/finish-run.js b/test/core/public/finish-run.js
index b87ccd0986..16efc131ea 100644
--- a/test/core/public/finish-run.js
+++ b/test/core/public/finish-run.js
@@ -1,17 +1,17 @@
-describe('axe.finishRun', function() {
+describe('axe.finishRun', function () {
var fixture = document.querySelector('#fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('takes a single partial results and outputs a finished report', function(done) {
+ it('takes a single partial results and outputs a finished report', function (done) {
axe
.runPartial()
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result]);
})
- .then(function(results) {
+ .then(function (results) {
assert.property(results, 'violations');
assert.property(results, 'passes');
assert.property(results, 'incomplete');
@@ -21,29 +21,29 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('does not mutate the options object', function(done) {
+ it('does not mutate the options object', function (done) {
var options = {};
axe
.runPartial(options)
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result], options);
})
- .then(function() {
+ .then(function () {
assert.deepEqual(options, {});
done();
})
.catch(done);
});
- it('uses option.reporter to create the report', function(done) {
+ it('uses option.reporter to create the report', function (done) {
axe
.runPartial()
- .then(function(partialResult) {
+ .then(function (partialResult) {
return axe.finishRun([partialResult], { reporter: 'raw' });
})
- .then(function(rawResults) {
+ .then(function (rawResults) {
assert.notEqual(rawResults.length, 0);
- rawResults.forEach(function(rawResult) {
+ rawResults.forEach(function (rawResult) {
assert.property(rawResult, 'violations');
assert.property(rawResult, 'passes');
assert.property(rawResult, 'incomplete');
@@ -54,26 +54,26 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('defaults options.reporter to v1', function(done) {
+ it('defaults options.reporter to v1', function (done) {
axe
.runPartial()
- .then(function(partialResult) {
+ .then(function (partialResult) {
return axe.finishRun([partialResult]);
})
- .then(function(results) {
+ .then(function (results) {
assert.equal(results.toolOptions.reporter, 'v1');
done();
})
.catch(done);
});
- it('normalizes the runOnly option in the reporter', function(done) {
+ it('normalizes the runOnly option in the reporter', function (done) {
axe
.runPartial()
- .then(function(partialResult) {
+ .then(function (partialResult) {
return axe.finishRun([partialResult], { runOnly: 'region' });
})
- .then(function(results) {
+ .then(function (results) {
assert.deepEqual(results.toolOptions.runOnly, {
type: 'rule',
values: ['region']
@@ -90,25 +90,25 @@ describe('axe.finishRun', function() {
};
axe
.runPartial()
- .then(function(partialResult) {
- partialResult.environmentData = { testEngine: testEngine }
+ .then(function (partialResult) {
+ partialResult.environmentData = { testEngine: testEngine };
return axe.finishRun([partialResult], { runOnly: 'region' });
})
- .then(function(results) {
+ .then(function (results) {
assert.deepEqual(results.testEngine, testEngine);
done();
})
.catch(done);
});
- it('can report violations results', function(done) {
+ it('can report violations results', function (done) {
fixture.innerHTML = '
';
axe
.runPartial({ include: ['#fixture'] }, { runOnly: 'aria-allowed-attr' })
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result]);
})
- .then(function(results) {
+ .then(function (results) {
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.incomplete, 0);
@@ -118,15 +118,15 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('can report passes results', function(done) {
+ it('can report passes results', function (done) {
fixture.innerHTML = '
';
axe
.runPartial({ include: ['#fixture'] }, { runOnly: 'aria-allowed-attr' })
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result]);
})
- .then(function(results) {
+ .then(function (results) {
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.incomplete, 0);
@@ -136,7 +136,7 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('can report incomplete results', function(done) {
+ it('can report incomplete results', function (done) {
fixture.innerHTML = '
';
axe
@@ -144,10 +144,10 @@ describe('axe.finishRun', function() {
{ include: ['#fixture'] },
{ runOnly: 'aria-valid-attr-value' }
)
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result]);
})
- .then(function(results) {
+ .then(function (results) {
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.incomplete, 1);
@@ -157,13 +157,13 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('can report inapplicable results', function(done) {
+ it('can report inapplicable results', function (done) {
axe
.runPartial({ include: ['#fixture'] }, { runOnly: 'aria-allowed-attr' })
- .then(function(result) {
+ .then(function (result) {
return axe.finishRun([result]);
})
- .then(function(results) {
+ .then(function (results) {
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.passes, 0);
assert.lengthOf(results.incomplete, 0);
@@ -173,7 +173,7 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('takes multiple partial results and outputs a finished report', function(done) {
+ it('takes multiple partial results and outputs a finished report', function (done) {
fixture.innerHTML =
'
' +
'
' +
@@ -182,24 +182,24 @@ describe('axe.finishRun', function() {
axe
.runPartial({ include: ['#pass'] }, { runOnly: 'aria-allowed-attr' })
- .then(function(results) {
+ .then(function (results) {
allResults.push(results);
return axe.runPartial(
{ include: ['#fail'] },
{ runOnly: 'aria-allowed-attr' }
);
})
- .then(function(results) {
+ .then(function (results) {
allResults.push(results);
return axe.runPartial(
{ include: ['#incomplete'] },
{ runOnly: 'aria-valid-attr-value' }
);
})
- .then(function(results) {
+ .then(function (results) {
return axe.finishRun(allResults.concat(results));
})
- .then(function(results) {
+ .then(function (results) {
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.incomplete, 1);
@@ -209,9 +209,9 @@ describe('axe.finishRun', function() {
.catch(done);
});
- describe('frames', function() {
+ describe('frames', function () {
function createIframe(html, parent) {
- return new Promise(function(resolve) {
+ return new Promise(function (resolve) {
parent = parent || fixture;
var doc = parent.ownerDocument;
var iframe = doc.createElement('iframe');
@@ -219,22 +219,22 @@ describe('axe.finishRun', function() {
var frameDoc = iframe.contentDocument;
frameDoc.write(html + '');
frameDoc.close();
- frameDoc.querySelector('script').onload = function() {
+ frameDoc.querySelector('script').onload = function () {
resolve(iframe.contentWindow);
};
});
}
- it('reconstructs which node is in which frame', function(done) {
+ it('reconstructs which node is in which frame', function (done) {
createIframe(' ')
- .then(function(frameWin) {
+ .then(function (frameWin) {
return Promise.all([
window.axe.runPartial({ runOnly: 'empty-heading' }),
frameWin.axe.runPartial({ runOnly: 'empty-heading' })
]);
})
.then(axe.finishRun)
- .then(function(results) {
+ .then(function (results) {
var nodes = results.violations[0].nodes;
assert.deepEqual(nodes[0].target, ['iframe', 'h1']);
done();
@@ -242,23 +242,23 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('handles nodes in nested iframes', function(done) {
+ it('handles nodes in nested iframes', function (done) {
var windows = [window];
fixture.innerHTML = ' ';
createIframe(' ')
- .then(function(frameWin) {
+ .then(function (frameWin) {
windows.push(frameWin);
return createIframe(' ', frameWin.document.body);
})
- .then(function(nestedWin) {
+ .then(function (nestedWin) {
windows.push(nestedWin);
- var promisedResults = windows.map(function(win) {
+ var promisedResults = windows.map(function (win) {
return win.axe.runPartial({ runOnly: 'empty-heading' });
});
return Promise.all(promisedResults);
})
.then(axe.finishRun)
- .then(function(results) {
+ .then(function (results) {
var nodes = results.violations[0].nodes;
assert.deepEqual(nodes[0].target, ['h1']);
assert.deepEqual(nodes[1].target, ['iframe', 'h2']);
@@ -268,27 +268,27 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('should handle null results and set target correctly', function(done) {
+ it('should handle null results and set target correctly', function (done) {
var windows = [window];
fixture.innerHTML = ' ';
createIframe(' ')
- .then(function(frameWin) {
+ .then(function (frameWin) {
windows.push(frameWin);
return createIframe(' ');
})
- .then(function(nestedWin) {
+ .then(function (nestedWin) {
windows.push(nestedWin);
- var promisedResults = windows.map(function(win) {
+ var promisedResults = windows.map(function (win) {
return win.axe.runPartial({ runOnly: 'empty-heading' });
});
return Promise.all(promisedResults);
})
- .then(function(partialResults) {
+ .then(function (partialResults) {
partialResults[1] = null;
return partialResults;
})
.then(axe.finishRun)
- .then(function(results) {
+ .then(function (results) {
var nodes = results.violations[0].nodes;
assert.deepEqual(nodes[0].target, ['h1']);
assert.deepEqual(nodes[1].target, ['iframe:nth-child(3)', 'h3']);
@@ -298,15 +298,15 @@ describe('axe.finishRun', function() {
});
});
- describe('calling audit.after', function() {
- it('passes results with iframe ancestries', function(done) {
+ describe('calling audit.after', function () {
+ it('passes results with iframe ancestries', function (done) {
fixture.innerHTML = ' ';
axe
.runPartial(fixture, { runOnly: 'duplicate-id' })
- .then(function(partialResult) {
+ .then(function (partialResult) {
return axe.finishRun([partialResult], { runOnly: 'duplicate-id' });
})
- .then(function(result) {
+ .then(function (result) {
var nodes = result.violations[0].nodes;
var relatedNodes = nodes[0].any[0].relatedNodes;
@@ -319,16 +319,16 @@ describe('axe.finishRun', function() {
.catch(done);
});
- it('provides the options object', function(done) {
+ it('provides the options object', function (done) {
var spy;
fixture.innerHTML = ' ';
axe
.runPartial(fixture, { runOnly: 'duplicate-id' })
- .then(function(partialResult) {
+ .then(function (partialResult) {
spy = sinon.spy(axe._audit, 'after');
return axe.finishRun([partialResult], { runOnly: 'duplicate-id' });
})
- .then(function() {
+ .then(function () {
assert.lengthOf(axe._audit.after.args, 1);
assert.deepEqual(axe._audit.after.args[0][1], {
runOnly: { type: 'rule', values: ['duplicate-id'] },
@@ -337,7 +337,7 @@ describe('axe.finishRun', function() {
spy.restore();
done();
})
- .catch(function(err) {
+ .catch(function (err) {
spy.restore();
done(err);
});
diff --git a/test/core/public/frame-messenger.js b/test/core/public/frame-messenger.js
index ce392d6047..d56332c2c0 100644
--- a/test/core/public/frame-messenger.js
+++ b/test/core/public/frame-messenger.js
@@ -1,11 +1,11 @@
-describe('frameMessenger', function() {
+describe('frameMessenger', function () {
var stub;
- after(function() {
+ after(function () {
stub.restore();
});
- it('should call into axe.utils.respondable.updateMessenger', function() {
+ it('should call into axe.utils.respondable.updateMessenger', function () {
stub = sinon.stub(axe.utils.respondable, 'updateMessenger');
axe.frameMessenger();
assert.isTrue(stub.called);
diff --git a/test/core/public/get-rules.js b/test/core/public/get-rules.js
index a511a4a7cc..540b459e6f 100644
--- a/test/core/public/get-rules.js
+++ b/test/core/public/get-rules.js
@@ -1,8 +1,8 @@
-describe('axe.getRules', function() {
+describe('axe.getRules', function () {
'use strict';
var ver = axe.version.substring(0, axe.version.lastIndexOf('.'));
- beforeEach(function() {
+ beforeEach(function () {
axe._load({
messages: [],
rules: [
@@ -35,11 +35,11 @@ describe('axe.getRules', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should return rules', function() {
+ it('should return rules', function () {
var retValue = axe.getRules(['tag1']);
assert.isArray(retValue);
assert.lengthOf(retValue, 2);
@@ -82,13 +82,13 @@ describe('axe.getRules', function() {
assert.deepEqual(retValue[0].actIds, ['abc123', 'xyz789']);
});
- it('should not return nothing', function() {
+ it('should not return nothing', function () {
var retValue = axe.getRules(['bob']);
assert.isArray(retValue);
assert.lengthOf(retValue, 0);
});
- it('should return all rules if given no tags - undefined', function() {
+ it('should return all rules if given no tags - undefined', function () {
var retValue = axe.getRules();
assert.equal(retValue[0].ruleId, 'awesomeRule1');
assert.equal(retValue[0].description, 'some interesting information');
@@ -114,7 +114,7 @@ describe('axe.getRules', function() {
assert.deepEqual(retValue[1].actIds, ['abc123', 'xyz789']);
});
- it('should return all rules if given empty array', function() {
+ it('should return all rules if given empty array', function () {
var retValue = axe.getRules([]);
assert.equal(retValue[0].ruleId, 'awesomeRule1');
assert.equal(retValue[0].description, 'some interesting information');
diff --git a/test/core/public/plugins.js b/test/core/public/plugins.js
index b909dd3ad2..d4b7009722 100644
--- a/test/core/public/plugins.js
+++ b/test/core/public/plugins.js
@@ -1,4 +1,4 @@
-describe('plugins', function() {
+describe('plugins', function () {
'use strict';
function createFrames(callback) {
@@ -28,27 +28,27 @@ describe('plugins', function() {
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe._audit = null;
});
- beforeEach(function() {
+ beforeEach(function () {
axe._load({
rules: []
});
});
- it('Should have registerPlugin function', function() {
+ it('Should have registerPlugin function', function () {
assert.ok(axe.registerPlugin);
assert.equal(typeof axe.registerPlugin, 'function');
});
- it('should have an empty set of plugins', function() {
+ it('should have an empty set of plugins', function () {
assert.deepEqual({}, axe.plugins);
});
- it('should add a plugin to the plugins list and a command to the audit commands', function() {
+ it('should add a plugin to the plugins list and a command to the audit commands', function () {
axe.registerPlugin({
id: 'my-plugin',
run: 'run',
@@ -63,12 +63,12 @@ describe('plugins', function() {
assert.equal(axe.plugins['my-plugin']._run, 'run');
assert.equal(axe._audit.commands['my-command'], 'callback');
});
- describe('Plugin class', function() {
- it('should call the run function of the registered plugin, when run is called', function() {
+ describe('Plugin class', function () {
+ it('should call the run function of the registered plugin, when run is called', function () {
var called = false;
axe.registerPlugin({
id: 'my-plugin',
- run: function(id, action, options) {
+ run: function (id, action, options) {
called = {
id: id,
action: action,
@@ -89,19 +89,19 @@ describe('plugins', function() {
);
});
});
- describe('Plugin.protoype.run', function() {
- afterEach(function() {
+ describe('Plugin.protoype.run', function () {
+ afterEach(function () {
fixture.innerHTML = '';
axe._audit = null;
axe.plugins = {};
});
- beforeEach(function() {
+ beforeEach(function () {
axe._load({
rules: []
});
axe.registerPlugin({
id: 'multi',
- run: function(id, action, options, callback) {
+ run: function (id, action, options, callback) {
this._registry[id][action].call(
this._registry[id],
options,
@@ -111,7 +111,7 @@ describe('plugins', function() {
commands: [
{
id: 'run-multi',
- callback: function(data, callback) {
+ callback: function (data, callback) {
return axe.plugins.multi.run(
data.parameter,
data.action,
@@ -124,18 +124,18 @@ describe('plugins', function() {
});
axe.plugins.multi.add({
id: 'hideall',
- cleanup: function(done) {
+ cleanup: function (done) {
done();
},
- run: function(options, callback) {
+ run: function (options, callback) {
var frames;
var q = axe.utils.queue();
frames = axe.utils.toArray(
document.querySelectorAll('iframe, frame')
);
- frames.forEach(function(frame) {
- q.defer(function(resolve, reject) {
+ frames.forEach(function (frame) {
+ q.defer(function (resolve, reject) {
axe.utils.sendCommandToFrame(
frame,
{
@@ -150,14 +150,14 @@ describe('plugins', function() {
});
});
- q.defer(function(done) {
+ q.defer(function (done) {
// implementation
done('ola!');
});
- q.then(function(data) {
+ q.then(function (data) {
// done with all the frames
var results = [];
- data.forEach(function(datum) {
+ data.forEach(function (datum) {
if (datum) {
results = results.concat(datum);
}
@@ -167,29 +167,29 @@ describe('plugins', function() {
}
});
});
- it('should work without frames', function(done) {
- axe.plugins.multi.run('hideall', 'run', {}, function(results) {
+ it('should work without frames', function (done) {
+ axe.plugins.multi.run('hideall', 'run', {}, function (results) {
assert.deepEqual(results, ['ola!']);
done();
});
});
- it('should work with frames', function(done) {
- createFrames(function() {
- setTimeout(function() {
- axe.plugins.multi.run('hideall', 'run', {}, function(results) {
+ it('should work with frames', function (done) {
+ createFrames(function () {
+ setTimeout(function () {
+ axe.plugins.multi.run('hideall', 'run', {}, function (results) {
assert.deepEqual(results, ['ola!', 'ola!', 'ola!', 'ola!', 'ola!']);
done();
});
}, 500);
});
});
- it("should call the implementation's cleanup function", function(done) {
+ it("should call the implementation's cleanup function", function (done) {
var called = false;
- axe.plugins.multi.cleanup = function(done) {
+ axe.plugins.multi.cleanup = function (done) {
called = true;
done();
};
- axe.plugins.multi.cleanup(function() {
+ axe.plugins.multi.cleanup(function () {
assert.ok(called);
done();
});
diff --git a/test/core/public/reporter.js b/test/core/public/reporter.js
index 0864f6c557..cc2b001615 100644
--- a/test/core/public/reporter.js
+++ b/test/core/public/reporter.js
@@ -1,27 +1,27 @@
-describe('axe.reporter', function() {
+describe('axe.reporter', function () {
'use strict';
var orig = {};
- before(function() {
+ before(function () {
orig.reporters = window.reporters;
});
- after(function() {
- Object.keys(orig).forEach(function(k) {
+ after(function () {
+ Object.keys(orig).forEach(function (k) {
window[k] = orig[k];
});
});
- it('should add reporter with given name', function() {
+ it('should add reporter with given name', function () {
axe.addReporter('bob', 'joe');
assert.equal(axe.getReporter('bob'), 'joe');
});
- it('returns false when reporter does not exist', function() {
+ it('returns false when reporter does not exist', function () {
assert.isFalse(axe.hasReporter('fancy-bob'));
});
- it('returns true when reporter exists', function() {
+ it('returns true when reporter exists', function () {
axe.addReporter('sponge');
assert.isTrue(axe.hasReporter('sponge'));
});
diff --git a/test/core/public/reset.js b/test/core/public/reset.js
index cd1ccf0845..93fc55536b 100644
--- a/test/core/public/reset.js
+++ b/test/core/public/reset.js
@@ -1,22 +1,22 @@
-describe('axe.reset', function() {
+describe('axe.reset', function () {
'use strict';
// var Rule = axe._thisWillBeDeletedDoNotUse.base.Rule;
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = null;
});
- it('should throw if no audit is configured', function() {
+ it('should throw if no audit is configured', function () {
assert.throws(
- function() {
+ function () {
axe.reset(
- function() {},
- function() {}
+ function () {},
+ function () {}
);
},
Error,
@@ -24,7 +24,7 @@ describe('axe.reset', function() {
);
});
- it('should restore the default configuration', function() {
+ it('should restore the default configuration', function () {
axe._load({
data: {
rules: {
@@ -77,8 +77,8 @@ describe('axe.reset', function() {
assert.equal(axe._audit.data.rules.bob.knows, 'not-joe');
});
- describe('when custom locale was provided', function() {
- beforeEach(function() {
+ describe('when custom locale was provided', function () {
+ beforeEach(function () {
axe._load({
data: {
checks: {
@@ -95,13 +95,13 @@ describe('axe.reset', function() {
checks: [
{
id: 'banana',
- evaluate: function() {}
+ evaluate: function () {}
}
]
});
});
- it('should restore the original locale', function() {
+ it('should restore the original locale', function () {
axe.configure({
locale: {
checks: {
@@ -124,7 +124,7 @@ describe('axe.reset', function() {
});
});
- it('should restore standards object', function() {
+ it('should restore standards object', function () {
axe._load({});
axe.configure({
diff --git a/test/core/public/run-partial.js b/test/core/public/run-partial.js
index 53cb2893d6..29273068e5 100644
--- a/test/core/public/run-partial.js
+++ b/test/core/public/run-partial.js
@@ -1,18 +1,18 @@
-describe('axe.runPartial', function() {
+describe('axe.runPartial', function () {
var fixture = document.getElementById('fixture');
var DqElement = axe.utils.DqElement;
var dqElementKeys = Object.keys(new DqElement(null).toJSON());
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('Uses axe._tree if it already exists', function(done) {
+ it('Uses axe._tree if it already exists', function (done) {
axe._tree = [axe.setup(fixture)];
fixture.innerHTML = ' ';
axe
.runPartial(document, { runOnly: 'image-alt' })
- .then(function(partialResult) {
+ .then(function (partialResult) {
var result = partialResult.results[0];
// 0, because was added after the tree was constructed
assert.lengthOf(result.nodes, 0);
@@ -21,10 +21,10 @@ describe('axe.runPartial', function() {
.catch(done);
});
- it('cleans up after resolving', function(done) {
+ it('cleans up after resolving', function (done) {
axe
.runPartial(document, { runOnly: 'image-alt' })
- .then(function() {
+ .then(function () {
assert.isUndefined(axe._tree);
assert.isUndefined(axe._selectorData);
assert.isFalse(axe._running);
@@ -33,10 +33,10 @@ describe('axe.runPartial', function() {
.catch(done);
});
- it('normalizes the options argument', function(done) {
+ it('normalizes the options argument', function (done) {
axe
.runPartial(/* no context */ { runOnly: 'image-alt' })
- .then(function(partialResult) {
+ .then(function (partialResult) {
assert.lengthOf(partialResult.results, 1);
assert.equal(partialResult.results[0].id, 'image-alt');
done();
@@ -44,28 +44,28 @@ describe('axe.runPartial', function() {
.catch(done);
});
- it('does not mutate the options object', function(done) {
+ it('does not mutate the options object', function (done) {
var options = {};
axe
.runPartial(options)
- .then(function() {
+ .then(function () {
assert.deepEqual(options, {});
done();
})
.catch(done);
});
- describe('result', function() {
+ describe('result', function () {
var partialResult;
- before(function(done) {
+ before(function (done) {
fixture.innerHTML = ' ';
- axe.runPartial(document, { runOnly: 'image-alt' }).then(function(out) {
+ axe.runPartial(document, { runOnly: 'image-alt' }).then(function (out) {
partialResult = out;
done();
});
});
- it('returns a result with all the valid properties', function() {
+ it('returns a result with all the valid properties', function () {
var result = partialResult.results[0];
assert.lengthOf(partialResult.results, 1);
assert.hasAllKeys(result, [
@@ -83,7 +83,7 @@ describe('axe.runPartial', function() {
assert.deepEqual(checkResult.node.selector, ['img']);
});
- it('returns check results with a serialized node', function() {
+ it('returns check results with a serialized node', function () {
var checkResult = partialResult.results[0].nodes[0];
assert.lengthOf(partialResult.results[0].nodes, 1);
assert.hasAllKeys(checkResult, ['any', 'all', 'none', 'node']);
@@ -91,16 +91,16 @@ describe('axe.runPartial', function() {
assert.hasAllKeys(checkResult.node, dqElementKeys);
});
- it('can be serialized using JSON.stringify', function() {
- assert.doesNotThrow(function() {
+ it('can be serialized using JSON.stringify', function () {
+ assert.doesNotThrow(function () {
JSON.stringify(partialResult);
});
});
});
- describe('frames', function() {
+ describe('frames', function () {
var partialResult;
- before(function(done) {
+ before(function (done) {
fixture.innerHTML =
'' +
' ' +
@@ -110,20 +110,20 @@ describe('axe.runPartial', function() {
axe
.runPartial('#fixture > main', { runOnly: 'image-alt' })
- .then(function(out) {
+ .then(function (out) {
partialResult = out;
done();
});
});
- it('only has frames in context', function() {
+ it('only has frames in context', function () {
assert.lengthOf(partialResult.frames, 2);
assert.deepEqual(partialResult.frames[0].selector, ['#foo']);
assert.deepEqual(partialResult.frames[1].selector, ['#bar']);
});
- it('provides serialized frame info', function() {
- partialResult.frames.forEach(function(frame) {
+ it('provides serialized frame info', function () {
+ partialResult.frames.forEach(function (frame) {
assert.hasAllKeys(frame, dqElementKeys);
});
});
@@ -133,45 +133,51 @@ describe('axe.runPartial', function() {
it('includes environment data for the initiator', function (done) {
var context = {
include: ['#fixture']
- }
- axe.runPartial(context, { runOnly: 'image-alt' }).then(function(out) {
- var keys = Object.keys(axe.utils.getEnvironmentData());
- assert.hasAllKeys(out.environmentData, keys);
- done();
- }).catch(done);
+ };
+ axe
+ .runPartial(context, { runOnly: 'image-alt' })
+ .then(function (out) {
+ var keys = Object.keys(axe.utils.getEnvironmentData());
+ assert.hasAllKeys(out.environmentData, keys);
+ done();
+ })
+ .catch(done);
});
it('is undefined for frames', function (done) {
var context = {
include: ['#fixture'],
initiator: false
- }
- axe.runPartial(context, { runOnly: 'image-alt' }).then(function(out) {
- assert.isUndefined(out.environmentData);
- done();
- }).catch(done);
+ };
+ axe
+ .runPartial(context, { runOnly: 'image-alt' })
+ .then(function (out) {
+ assert.isUndefined(out.environmentData);
+ done();
+ })
+ .catch(done);
});
});
- describe('guards', function() {
+ describe('guards', function () {
var audit = axe._audit;
- afterEach(function() {
+ afterEach(function () {
axe._audit = audit;
axe._running = false;
});
- it('throws when axe._audit is undefined', function() {
+ it('throws when axe._audit is undefined', function () {
axe._audit = null;
- assert.throws(function() {
+ assert.throws(function () {
axe.runPartial();
});
});
- it('throws if axe is already running', function(done) {
- axe.runPartial().then(function() {
+ it('throws if axe is already running', function (done) {
+ axe.runPartial().then(function () {
done();
});
- assert.throws(function() {
+ assert.throws(function () {
axe.runPartial();
});
});
diff --git a/test/core/public/run-virtual-rule.js b/test/core/public/run-virtual-rule.js
index b15fca7602..bc69eb0489 100644
--- a/test/core/public/run-virtual-rule.js
+++ b/test/core/public/run-virtual-rule.js
@@ -1,5 +1,5 @@
-describe('axe.runVirtualRule', function() {
- beforeEach(function() {
+describe('axe.runVirtualRule', function () {
+ beforeEach(function () {
axe._load({
rules: [
{
@@ -11,7 +11,7 @@ describe('axe.runVirtualRule', function() {
checks: [
{
id: 'fred',
- evaluate: function() {
+ evaluate: function () {
return true;
}
}
@@ -19,11 +19,11 @@ describe('axe.runVirtualRule', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should throw if the rule does not exist', function() {
+ it('should throw if the rule does not exist', function () {
axe._audit.rules = [];
function fn() {
axe.runVirtualRule('aria-roles', { nodeName: 'div' });
@@ -32,12 +32,12 @@ describe('axe.runVirtualRule', function() {
assert.throws(fn);
});
- it('should modify the rule to not excludeHidden', function() {
+ it('should modify the rule to not excludeHidden', function () {
axe._audit.rules = [
{
id: 'aria-roles',
excludeHidden: true,
- runSync: function() {
+ runSync: function () {
assert.isFalse(this.excludeHidden);
return {
@@ -51,12 +51,12 @@ describe('axe.runVirtualRule', function() {
axe.runVirtualRule('aria-roles', { nodeName: 'div' });
});
- it('should not modify the original rule', function() {
+ it('should not modify the original rule', function () {
axe._audit.rules = [
{
id: 'aria-roles',
excludeHidden: true,
- runSync: function() {
+ runSync: function () {
assert.notEqual(this, axe._audit.rules[0]);
return {
@@ -70,12 +70,12 @@ describe('axe.runVirtualRule', function() {
axe.runVirtualRule('aria-roles', { nodeName: 'div' });
});
- it('should call rule.runSync', function() {
+ it('should call rule.runSync', function () {
var called = false;
axe._audit.rules = [
{
id: 'aria-roles',
- runSync: function() {
+ runSync: function () {
called = true;
return {
id: 'aria-roles',
@@ -89,12 +89,12 @@ describe('axe.runVirtualRule', function() {
assert.isTrue(called);
});
- it('should pass a virtual context to rule.runSync', function() {
+ it('should pass a virtual context to rule.runSync', function () {
var node = new axe.SerialVirtualNode({ nodeName: 'div' });
axe._audit.rules = [
{
id: 'aria-roles',
- runSync: function(context) {
+ runSync: function (context) {
assert.equal(typeof context, 'object');
assert.isTrue(Array.isArray(context.include));
assert.equal(context.include[0], node);
@@ -110,11 +110,11 @@ describe('axe.runVirtualRule', function() {
axe.runVirtualRule('aria-roles', node);
});
- it('should pass through options to rule.runSync', function() {
+ it('should pass through options to rule.runSync', function () {
axe._audit.rules = [
{
id: 'aria-roles',
- runSync: function(context, options) {
+ runSync: function (context, options) {
assert.equal(options.foo, 'bar');
return {
@@ -128,7 +128,7 @@ describe('axe.runVirtualRule', function() {
axe.runVirtualRule('aria-roles', { nodeName: 'div' }, { foo: 'bar' });
});
- it('should convert a serialised node into a VirtualNode', function() {
+ it('should convert a serialised node into a VirtualNode', function () {
var serialNode = {
nodeName: 'div',
foo: 'bar',
@@ -139,7 +139,7 @@ describe('axe.runVirtualRule', function() {
axe._audit.rules = [
{
id: 'aria-roles',
- runSync: function(context) {
+ runSync: function (context) {
var node = context.include[0];
assert.instanceOf(node, axe.AbstractVirtualNode);
assert.equal(node.props.foo, 'bar');
@@ -156,7 +156,7 @@ describe('axe.runVirtualRule', function() {
axe.runVirtualRule('aria-roles', serialNode);
});
- it('should return correct structure', function() {
+ it('should return correct structure', function () {
var results = axe.runVirtualRule('test', { nodeName: 'div' });
assert.isDefined(results.violations);
assert.isDefined(results.passes);
diff --git a/test/core/public/setup.js b/test/core/public/setup.js
index 01144a8097..085848db4b 100644
--- a/test/core/public/setup.js
+++ b/test/core/public/setup.js
@@ -1,38 +1,38 @@
-describe('axe.setup', function() {
+describe('axe.setup', function () {
'use strict';
- afterEach(function() {
+ afterEach(function () {
axe.teardown();
});
- it('should setup the tree', function() {
+ it('should setup the tree', function () {
axe._tree = undefined;
axe.setup();
assert.exists(axe._tree);
});
- it('should default the tree to use html element', function() {
+ it('should default the tree to use html element', function () {
axe.setup();
assert.equal(axe._tree[0].actualNode, document.documentElement);
});
- it('should use the passed in node as the root of the tree', function() {
+ it('should use the passed in node as the root of the tree', function () {
axe.setup(document.body);
assert.equal(axe._tree[0].actualNode, document.body);
});
- it('should return the root node', function() {
+ it('should return the root node', function () {
var vNode = axe.setup(document.body);
assert.equal(vNode.actualNode, document.body);
});
- it('should setup selector data', function() {
+ it('should setup selector data', function () {
axe._selectorData = undefined;
axe.setup();
assert.exists(axe._selectorData);
});
- it('should throw if called twice in a row', function() {
+ it('should throw if called twice in a row', function () {
function fn() {
axe.setup();
axe.setup();
diff --git a/test/core/public/teardown.js b/test/core/public/teardown.js
index 5af042892b..f9916862fb 100644
--- a/test/core/public/teardown.js
+++ b/test/core/public/teardown.js
@@ -1,29 +1,29 @@
-describe('axe.teardown', function() {
+describe('axe.teardown', function () {
'use strict';
- it('should reset the tree', function() {
+ it('should reset the tree', function () {
axe._tree = 'foo';
axe.teardown();
assert.isUndefined(axe._tree);
});
- it('should reset selector data', function() {
+ it('should reset selector data', function () {
axe._selectorData = 'foo';
axe.teardown();
assert.isUndefined(axe._selectorData);
});
- it('should reset selector data', function() {
+ it('should reset selector data', function () {
axe._selectCache = 'foo';
axe.teardown();
assert.isUndefined(axe._selectCache);
});
- it('should reset memozied functions', function() {
+ it('should reset memozied functions', function () {
var orgFn = axe._memoizedFns[0];
var called = false;
axe._memoizedFns[0] = {
- clear: function() {
+ clear: function () {
called = true;
}
};
@@ -32,10 +32,10 @@ describe('axe.teardown', function() {
axe._memoizedFns[0] = orgFn;
});
- it('should reset the cache', function() {
+ it('should reset the cache', function () {
var orgFn = axe._cache.clear;
var called = false;
- axe._cache.clear = function() {
+ axe._cache.clear = function () {
called = true;
};
axe.teardown();
diff --git a/test/core/reporters/helpers/failure-summary.js b/test/core/reporters/helpers/failure-summary.js
index 6d3822fd37..2938d447f3 100644
--- a/test/core/reporters/helpers/failure-summary.js
+++ b/test/core/reporters/helpers/failure-summary.js
@@ -1,6 +1,6 @@
-describe('helpers.failureSummary', function() {
+describe('helpers.failureSummary', function () {
'use strict';
- beforeEach(function() {
+ beforeEach(function () {
axe._load({
messages: {},
rules: [],
@@ -48,7 +48,7 @@ describe('helpers.failureSummary', function() {
});
});
- it('should concatenate none and all', function() {
+ it('should concatenate none and all', function () {
var summary = helpers.failureSummary({
result: 'failed',
any: [],
@@ -73,7 +73,7 @@ describe('helpers.failureSummary', function() {
assert.equal(summary, 'Fix all of the following: \n 1\n 2\n 3\n');
});
- it('should return a list of ANYs if none return true', function() {
+ it('should return a list of ANYs if none return true', function () {
var summary = helpers.failureSummary({
result: 'failed',
any: [
@@ -97,7 +97,7 @@ describe('helpers.failureSummary', function() {
assert.equal(summary, 'Fix any of the following: \n 1\n 2\n 3\n');
});
- it('should concatenate anys', function() {
+ it('should concatenate anys', function () {
var summary = helpers.failureSummary({
result: 'failed',
any: [
diff --git a/test/core/reporters/helpers/incomplete-fallback-msg.js b/test/core/reporters/helpers/incomplete-fallback-msg.js
index 4f0d9bbd44..52bf0d6c71 100644
--- a/test/core/reporters/helpers/incomplete-fallback-msg.js
+++ b/test/core/reporters/helpers/incomplete-fallback-msg.js
@@ -1,4 +1,4 @@
-describe('helpers.incompleteFallbackMessage', function() {
+describe('helpers.incompleteFallbackMessage', function () {
'use strict';
it('returns a non-empty string by default', function () {
@@ -7,7 +7,7 @@ describe('helpers.incompleteFallbackMessage', function() {
assert.notEqual(summary, '');
});
- it('should return a string', function() {
+ it('should return a string', function () {
axe._load({
messages: {},
rules: [],
@@ -19,7 +19,7 @@ describe('helpers.incompleteFallbackMessage', function() {
assert.equal(summary, 'Dogs are the best');
});
- it('should handle doT.js template function', function() {
+ it('should handle doT.js template function', function () {
axe._load({
messages: {},
rules: [],
diff --git a/test/core/reporters/helpers/process-aggregate.js b/test/core/reporters/helpers/process-aggregate.js
index 9c82cec4e1..520f88ea85 100644
--- a/test/core/reporters/helpers/process-aggregate.js
+++ b/test/core/reporters/helpers/process-aggregate.js
@@ -1,8 +1,8 @@
-describe('helpers.processAggregate', function() {
+describe('helpers.processAggregate', function () {
'use strict';
var results, options;
- beforeEach(function() {
+ beforeEach(function () {
results = [
{
id: 'passed-rule',
@@ -129,37 +129,37 @@ describe('helpers.processAggregate', function() {
];
});
- it('should remove the `result` property from each node in each ruleResult', function() {
+ it('should remove the `result` property from each node in each ruleResult', function () {
assert.isDefined(
- results.find(function(r) {
+ results.find(function (r) {
return r.id === 'passed-rule';
}).passes[0].result
);
var resultObject = helpers.processAggregate(results, {});
- var ruleResult = resultObject.passes.find(function(r) {
+ var ruleResult = resultObject.passes.find(function (r) {
return r.id === 'passed-rule';
});
assert.isUndefined(ruleResult.nodes[0].result);
});
- it('should remove the `node` property from each node in each ruleResult', function() {
+ it('should remove the `node` property from each node in each ruleResult', function () {
assert.isDefined(
- results.find(function(r) {
+ results.find(function (r) {
return r.id === 'passed-rule';
}).passes[0].node
);
var resultObject = helpers.processAggregate(results, {});
- var ruleResult = resultObject.passes.find(function(r) {
+ var ruleResult = resultObject.passes.find(function (r) {
return r.id === 'passed-rule';
});
assert.isUndefined(ruleResult.nodes[0].node);
});
- describe('`options` argument', function() {
- describe('`resultTypes` option', function() {
- it('should reduce the unwanted result types to 1 in the `resultObject`', function() {
+ describe('`options` argument', function () {
+ describe('`resultTypes` option', function () {
+ it('should reduce the unwanted result types to 1 in the `resultObject`', function () {
var resultObject = helpers.processAggregate(results, {
resultTypes: ['violations']
});
@@ -177,14 +177,14 @@ describe('helpers.processAggregate', function() {
});
});
- describe('`elementRef` option', function() {
- describe('when set to true', function() {
- before(function() {
+ describe('`elementRef` option', function () {
+ describe('when set to true', function () {
+ before(function () {
options = { elementRef: true };
});
- describe("when node's, or relatedNode's, `fromFrame` equals false", function() {
- it('should add an `element` property to the subResult nodes or relatedNodes', function() {
+ describe("when node's, or relatedNode's, `fromFrame` equals false", function () {
+ it('should add an `element` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isDefined(resultObject.passes[0].nodes[0].element);
assert.isDefined(
@@ -193,8 +193,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe("when node's, or relatedNode's, `fromFrame` equals true", function() {
- it('should NOT add an `element` property to the subResult nodes or relatedNodes', function() {
+ describe("when node's, or relatedNode's, `fromFrame` equals true", function () {
+ it('should NOT add an `element` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isUndefined(resultObject.violations[0].nodes[0].element);
assert.isUndefined(
@@ -204,12 +204,12 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when set to false', function() {
- before(function() {
+ describe('when set to false', function () {
+ before(function () {
options = { elementRef: false };
});
- it('should NOT add an `element` property to the subResult nodes or relatedNodes', function() {
+ it('should NOT add an `element` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isUndefined(resultObject.passes[0].nodes[0].element);
assert.isUndefined(resultObject.violations[0].nodes[0].element);
@@ -222,8 +222,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when not set at all', function() {
- it('should NOT add an `element` property to the subResult nodes or relatedNodes', function() {
+ describe('when not set at all', function () {
+ it('should NOT add an `element` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {});
assert.isUndefined(resultObject.passes[0].nodes[0].element);
assert.isUndefined(resultObject.violations[0].nodes[0].element);
@@ -237,14 +237,14 @@ describe('helpers.processAggregate', function() {
});
});
- describe('`selectors` option', function() {
- describe('when set to false', function() {
- before(function() {
+ describe('`selectors` option', function () {
+ describe('when set to false', function () {
+ before(function () {
options = { selectors: false };
});
- describe("when node's, or relatedNode's, `fromFrame` equals true", function() {
- it('should add a `target` property to the subResult nodes or relatedNodes', function() {
+ describe("when node's, or relatedNode's, `fromFrame` equals true", function () {
+ it('should add a `target` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isDefined(resultObject.violations[0].nodes[0].target);
assert.isDefined(
@@ -253,8 +253,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe("when node's, or relatedNode's, `fromFrame` equals false", function() {
- it('should NOT add a `target` property to the subResult nodes or relatedNodes', function() {
+ describe("when node's, or relatedNode's, `fromFrame` equals false", function () {
+ it('should NOT add a `target` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isUndefined(resultObject.passes[0].nodes[0].target);
assert.isUndefined(
@@ -264,12 +264,12 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when set to true', function() {
- before(function() {
+ describe('when set to true', function () {
+ before(function () {
options = { selectors: true };
});
- it('should add a `target` property to the subResult nodes or relatedNodes', function() {
+ it('should add a `target` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isDefined(resultObject.passes[0].nodes[0].target);
assert.isDefined(
@@ -278,8 +278,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when not set at all', function() {
- it('should add a `target` property to the subResult nodes or relatedNodes', function() {
+ describe('when not set at all', function () {
+ it('should add a `target` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {});
assert.isDefined(resultObject.passes[0].nodes[0].target);
assert.isDefined(
@@ -289,9 +289,9 @@ describe('helpers.processAggregate', function() {
});
});
- describe('`ancestry` option', function() {
- describe('when set to true', function() {
- it('should add an `ancestry` property to the subResult nodes or relatedNodes', function() {
+ describe('`ancestry` option', function () {
+ describe('when set to true', function () {
+ it('should add an `ancestry` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {
ancestry: true
});
@@ -302,8 +302,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when set to false', function() {
- it('should NOT add an `ancestry` property to the subResult nodes or relatedNodes', function() {
+ describe('when set to false', function () {
+ it('should NOT add an `ancestry` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {
ancestry: false
});
@@ -314,8 +314,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when not set at all', function() {
- it('should NOT add an `ancestry` property to the subResult nodes or relatedNodes', function() {
+ describe('when not set at all', function () {
+ it('should NOT add an `ancestry` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {});
assert.isUndefined(resultObject.passes[0].nodes[0].ancestry);
assert.isUndefined(
@@ -325,13 +325,13 @@ describe('helpers.processAggregate', function() {
});
});
- describe('`xpath` option', function() {
- describe('when set to true', function() {
- before(function() {
+ describe('`xpath` option', function () {
+ describe('when set to true', function () {
+ before(function () {
options = { xpath: true };
});
- it('should add an `xpath` property to the subResult nodes or relatedNodes', function() {
+ it('should add an `xpath` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isDefined(resultObject.passes[0].nodes[0].xpath);
assert.isDefined(
@@ -340,12 +340,12 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when set to false', function() {
- before(function() {
+ describe('when set to false', function () {
+ before(function () {
options = { xpath: false };
});
- it('should NOT add an `xpath` property to the subResult nodes or relatedNodes', function() {
+ it('should NOT add an `xpath` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, options);
assert.isUndefined(resultObject.passes[0].nodes[0].xpath);
assert.isUndefined(
@@ -354,8 +354,8 @@ describe('helpers.processAggregate', function() {
});
});
- describe('when not set at all', function() {
- it('should NOT add an `xpath` property to the subResult nodes or relatedNodes', function() {
+ describe('when not set at all', function () {
+ it('should NOT add an `xpath` property to the subResult nodes or relatedNodes', function () {
var resultObject = helpers.processAggregate(results, {});
assert.isUndefined(resultObject.passes[0].nodes[0].xpath);
assert.isUndefined(
diff --git a/test/core/reporters/na.js b/test/core/reporters/na.js
index 3c1ee57358..a9c677725f 100644
--- a/test/core/reporters/na.js
+++ b/test/core/reporters/na.js
@@ -1,4 +1,4 @@
-describe('reporters - na', function() {
+describe('reporters - na', function () {
'use strict';
var runResults,
_results = [
@@ -96,7 +96,7 @@ describe('reporters - na', function() {
}
];
- beforeEach(function() {
+ beforeEach(function () {
runResults = JSON.parse(JSON.stringify(_results));
axe._load({
messages: {},
@@ -105,12 +105,12 @@ describe('reporters - na', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should merge the runRules results into violations, passes and inapplicable', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should merge the runRules results into violations, passes and inapplicable', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.isObject(results);
assert.isArray(results.violations);
assert.lengthOf(results.violations, 1);
@@ -120,29 +120,29 @@ describe('reporters - na', function() {
assert.lengthOf(results.inapplicable, 1);
});
});
- it('should add the rule id to the rule result', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the rule id to the rule result', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.equal(results.violations[0].id, 'idkStuff');
assert.equal(results.passes[0].id, 'gimmeLabel');
assert.equal(results.inapplicable[0].id, 'noMatch');
});
});
- it('should add tags to the rule result', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add tags to the rule result', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.deepEqual(results.violations[0].tags, ['tag2']);
assert.deepEqual(results.passes[0].tags, ['tag1']);
assert.deepEqual(results.inapplicable[0].tags, ['tag3']);
});
});
- it('should add the rule help to the rule result', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the rule help to the rule result', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.ok(!results.violations[0].helpUrl);
assert.equal(results.passes[0].helpUrl, 'things');
assert.equal(results.inapplicable[0].helpUrl, 'somewhere');
});
});
- it('should add the html to the node data', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the html to the node data', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.equal(
@@ -152,8 +152,8 @@ describe('reporters - na', function() {
assert.equal(results.passes[0].nodes[0].html, 'chimp');
});
});
- it('should add the target selector array to the node data', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the target selector array to the node data', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.deepEqual(results.violations[0].nodes[0].target, [
@@ -163,14 +163,14 @@ describe('reporters - na', function() {
]);
});
});
- it('should add the description to the rule result', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the description to the rule result', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.equal(results.violations[0].description, 'something more nifty');
assert.equal(results.passes[0].description, 'something nifty');
});
});
- it('should add the impact to the rule result', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add the impact to the rule result', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.equal(results.violations[0].impact, 'cats');
assert.equal(results.violations[0].nodes[0].impact, 'cats');
assert.ok(!results.passes[0].impact);
@@ -179,8 +179,8 @@ describe('reporters - na', function() {
assert.isNull(results.passes[0].nodes[0].impact);
});
});
- it('should map relatedNodes', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should map relatedNodes', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.lengthOf(results.violations[0].nodes[0].all[0].relatedNodes, 1);
assert.equal(
results.violations[0].nodes[0].all[0].relatedNodes[0].target,
@@ -202,29 +202,33 @@ describe('reporters - na', function() {
);
});
});
- it('should add environment data', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add environment data', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.isDefined(results.url);
assert.isDefined(results.timestamp);
assert.isDefined(results.testEnvironment);
assert.isDefined(results.testRunner);
});
});
- it('should add toolOptions property', function() {
- axe.getReporter('na')(runResults, {}, function(results) {
+ it('should add toolOptions property', function () {
+ axe.getReporter('na')(runResults, {}, function (results) {
assert.isDefined(results.toolOptions);
});
});
it('uses the environmentData option instead of environment data if specified', function () {
var environmentData = {
myReporter: 'hello world'
- }
- axe.getReporter('na')(runResults, { environmentData: environmentData }, function(results) {
- assert.equal(results.myReporter, 'hello world');
- assert.isUndefined(results.url);
- assert.isUndefined(results.timestamp);
- assert.isUndefined(results.testEnvironment);
- assert.isUndefined(results.testRunner);
- });
+ };
+ axe.getReporter('na')(
+ runResults,
+ { environmentData: environmentData },
+ function (results) {
+ assert.equal(results.myReporter, 'hello world');
+ assert.isUndefined(results.url);
+ assert.isUndefined(results.timestamp);
+ assert.isUndefined(results.testEnvironment);
+ assert.isUndefined(results.testRunner);
+ }
+ );
});
});
diff --git a/test/core/reporters/no-passes.js b/test/core/reporters/no-passes.js
index d24a84df2f..5947617327 100644
--- a/test/core/reporters/no-passes.js
+++ b/test/core/reporters/no-passes.js
@@ -1,4 +1,4 @@
-describe('reporters - no-passes', function() {
+describe('reporters - no-passes', function () {
'use strict';
var runResults,
_results = [
@@ -85,7 +85,7 @@ describe('reporters - no-passes', function() {
]
}
];
- beforeEach(function() {
+ beforeEach(function () {
runResults = JSON.parse(JSON.stringify(_results));
axe._load({
messages: {},
@@ -94,35 +94,35 @@ describe('reporters - no-passes', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should merge the runRules results into violations and exclude passes', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should merge the runRules results into violations and exclude passes', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.isObject(results);
assert.isArray(results.violations);
assert.lengthOf(results.violations, 1);
assert.isUndefined(results.passes);
});
});
- it('should add the rule id to the rule result', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the rule id to the rule result', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.equal(results.violations[0].id, 'idkStuff');
});
});
- it('should add tags to the rule result', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add tags to the rule result', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.deepEqual(results.violations[0].tags, ['tag2']);
});
});
- it('should add the rule help to the rule result', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the rule help to the rule result', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.isNotOk(results.violations[0].helpUrl);
});
});
- it('should add the html to the node data', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the html to the node data', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.equal(
@@ -131,8 +131,8 @@ describe('reporters - no-passes', function() {
);
});
});
- it('should add the target selector array to the node data', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the target selector array to the node data', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.deepEqual(results.violations[0].nodes[0].target, [
@@ -142,19 +142,19 @@ describe('reporters - no-passes', function() {
]);
});
});
- it('should add the description to the rule result', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the description to the rule result', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.equal(results.violations[0].description, 'something more nifty');
});
});
- it('should add the impact to the rule result', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add the impact to the rule result', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.equal(results.violations[0].impact, 'cats');
assert.equal(results.violations[0].nodes[0].impact, 'cats');
});
});
- it('should map relatedNodes', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should map relatedNodes', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.lengthOf(results.violations[0].nodes[0].all[0].relatedNodes, 1);
assert.equal(
results.violations[0].nodes[0].all[0].relatedNodes[0].target,
@@ -166,29 +166,33 @@ describe('reporters - no-passes', function() {
);
});
});
- it('should add environment data', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add environment data', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.isDefined(results.url);
assert.isDefined(results.timestamp);
assert.isDefined(results.testEnvironment);
assert.isDefined(results.testRunner);
});
});
- it('should add toolOptions property', function() {
- axe.getReporter('no-passes')(runResults, {}, function(results) {
+ it('should add toolOptions property', function () {
+ axe.getReporter('no-passes')(runResults, {}, function (results) {
assert.isDefined(results.toolOptions);
});
});
it('uses the environmentData option instead of environment data if specified', function () {
var environmentData = {
myReporter: 'hello world'
- }
- axe.getReporter('no-passes')(runResults, { environmentData: environmentData }, function(results) {
- assert.equal(results.myReporter, 'hello world');
- assert.isUndefined(results.url);
- assert.isUndefined(results.timestamp);
- assert.isUndefined(results.testEnvironment);
- assert.isUndefined(results.testRunner);
- });
+ };
+ axe.getReporter('no-passes')(
+ runResults,
+ { environmentData: environmentData },
+ function (results) {
+ assert.equal(results.myReporter, 'hello world');
+ assert.isUndefined(results.url);
+ assert.isUndefined(results.timestamp);
+ assert.isUndefined(results.testEnvironment);
+ assert.isUndefined(results.testRunner);
+ }
+ );
});
});
diff --git a/test/core/reporters/raw-env.js b/test/core/reporters/raw-env.js
index 448cfddae8..84550453bd 100644
--- a/test/core/reporters/raw-env.js
+++ b/test/core/reporters/raw-env.js
@@ -1,4 +1,4 @@
-describe('reporters - raw-env', function() {
+describe('reporters - raw-env', function () {
'use strict';
var fixture = document.getElementById('fixture');
@@ -11,7 +11,7 @@ describe('reporters - raw-env', function() {
var runResults;
- beforeEach(function() {
+ beforeEach(function () {
runResults = [
{
id: 'gimmeLabel',
@@ -111,12 +111,12 @@ describe('reporters - raw-env', function() {
axe._cache.set('selectorData', {});
});
- after(function() {
+ after(function () {
fixture.innerHTML = '';
});
- it('should serialize DqElements (#1195)', function() {
- axe.getReporter('rawEnv')(runResults, {}, function(results) {
+ it('should serialize DqElements (#1195)', function () {
+ axe.getReporter('rawEnv')(runResults, {}, function (results) {
for (var i = 0; i < results.length; i++) {
var result = results[i];
for (var j = 0; j < result.passes.length; j++) {
@@ -127,8 +127,8 @@ describe('reporters - raw-env', function() {
});
});
- it('should pass env object', function() {
- axe.getReporter('rawEnv')(runResults, {}, function(results) {
+ it('should pass env object', function () {
+ axe.getReporter('rawEnv')(runResults, {}, function (results) {
assert.isDefined(results.env);
assert.isDefined(results.env.url);
assert.isDefined(results.env.timestamp);
@@ -140,9 +140,13 @@ describe('reporters - raw-env', function() {
it('uses the environmentData option instead of environment data if specified', function () {
var environmentData = {
myReporter: 'hello world'
- }
- axe.getReporter('rawEnv')(runResults, { environmentData: environmentData }, function(results) {
- assert.deepEqual(results.env, environmentData);
- });
+ };
+ axe.getReporter('rawEnv')(
+ runResults,
+ { environmentData: environmentData },
+ function (results) {
+ assert.deepEqual(results.env, environmentData);
+ }
+ );
});
});
diff --git a/test/core/reporters/raw.js b/test/core/reporters/raw.js
index d8a94e20b6..61648759af 100644
--- a/test/core/reporters/raw.js
+++ b/test/core/reporters/raw.js
@@ -1,4 +1,4 @@
-describe('reporters - raw', function() {
+describe('reporters - raw', function () {
'use strict';
var fixture = document.getElementById('fixture');
@@ -11,7 +11,7 @@ describe('reporters - raw', function() {
var runResults;
- beforeEach(function() {
+ beforeEach(function () {
runResults = [
{
id: 'gimmeLabel',
@@ -111,12 +111,12 @@ describe('reporters - raw', function() {
axe._cache.set('selectorData', {});
});
- after(function() {
+ after(function () {
fixture.innerHTML = '';
});
- it('should serialize DqElements', function(done) {
- axe.getReporter('rawEnv')(runResults, {}, function(results) {
+ it('should serialize DqElements', function (done) {
+ axe.getReporter('rawEnv')(runResults, {}, function (results) {
for (var i = 0; i < results.length; i++) {
var result = results[i];
for (var j = 0; j < result.passes.length; j++) {
@@ -128,11 +128,11 @@ describe('reporters - raw', function() {
});
});
- it('does not throw on serialized nodes', function(done) {
+ it('does not throw on serialized nodes', function (done) {
var rawReporter = axe.getReporter('rawEnv');
- rawReporter(runResults, {}, function(serializedResults) {
- assert.doesNotThrow(function() {
- rawReporter(serializedResults, {}, function() {
+ rawReporter(runResults, {}, function (serializedResults) {
+ assert.doesNotThrow(function () {
+ rawReporter(serializedResults, {}, function () {
done();
});
});
diff --git a/test/core/reporters/v1.js b/test/core/reporters/v1.js
index 8e4e532883..8ebc2c557c 100644
--- a/test/core/reporters/v1.js
+++ b/test/core/reporters/v1.js
@@ -1,4 +1,4 @@
-describe('reporters - v1', function() {
+describe('reporters - v1', function () {
'use strict';
var runResults,
_results = [
@@ -134,7 +134,7 @@ describe('reporters - v1', function() {
]
}
];
- beforeEach(function() {
+ beforeEach(function () {
runResults = JSON.parse(JSON.stringify(_results));
axe._load({
messages: {},
@@ -183,12 +183,12 @@ describe('reporters - v1', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should merge the runRules results into violations and passes', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should merge the runRules results into violations and passes', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.isObject(results);
assert.isArray(results.violations);
assert.lengthOf(results.violations, 2);
@@ -196,32 +196,32 @@ describe('reporters - v1', function() {
assert.lengthOf(results.passes, 2);
});
});
- it('should add the rule id to the rule result', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the rule id to the rule result', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.equal(results.violations[0].id, 'idkStuff');
assert.equal(results.violations[1].id, 'bypass');
assert.equal(results.passes[0].id, 'gimmeLabel');
assert.equal(results.passes[1].id, 'blinky');
});
});
- it('should add tags to the rule result', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add tags to the rule result', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.deepEqual(results.violations[0].tags, ['tag2']);
assert.deepEqual(results.violations[1].tags, ['tag3']);
assert.deepEqual(results.passes[0].tags, ['tag1']);
assert.deepEqual(results.passes[1].tags, ['tag4']);
});
});
- it('should add the rule help to the rule result', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the rule help to the rule result', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.isNotOk(results.violations[0].helpUrl);
assert.isNotOk(results.violations[1].helpUrl);
assert.equal(results.passes[0].helpUrl, 'things');
assert.isNotOk(results.passes[1].helpUrl);
});
});
- it('should add the html to the node data', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the html to the node data', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.equal(
@@ -239,8 +239,8 @@ describe('reporters - v1', function() {
);
});
});
- it('should add the failure summary to the node data', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the failure summary to the node data', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.equal(
@@ -253,8 +253,8 @@ describe('reporters - v1', function() {
);
});
});
- it('should add the target selector array to the node data', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the target selector array to the node data', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.deepEqual(results.violations[0].nodes[0].target, [
@@ -264,8 +264,8 @@ describe('reporters - v1', function() {
]);
});
});
- it('should add the description to the rule result', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the description to the rule result', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.equal(results.violations[0].description, 'something more nifty');
assert.equal(
results.violations[1].description,
@@ -275,37 +275,41 @@ describe('reporters - v1', function() {
assert.equal(results.passes[1].description, 'something awesome');
});
});
- it('should add the impact to the rule result', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add the impact to the rule result', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.equal(results.violations[0].impact, 'cats');
assert.equal(results.violations[0].nodes[0].impact, 'cats');
assert.equal(results.violations[1].impact, 'monkeys');
assert.equal(results.violations[1].nodes[0].impact, 'monkeys');
});
});
- it('should add environment data', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add environment data', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.isDefined(results.url);
assert.isDefined(results.timestamp);
assert.isDefined(results.testEnvironment);
assert.isDefined(results.testRunner);
});
});
- it('should add toolOptions property', function() {
- axe.getReporter('v1')(runResults, {}, function(results) {
+ it('should add toolOptions property', function () {
+ axe.getReporter('v1')(runResults, {}, function (results) {
assert.isDefined(results.toolOptions);
});
});
it('uses the environmentData option instead of environment data if specified', function () {
var environmentData = {
myReporter: 'hello world'
- }
- axe.getReporter('v1')(runResults, { environmentData: environmentData }, function(results) {
- assert.equal(results.myReporter, 'hello world');
- assert.isUndefined(results.url);
- assert.isUndefined(results.timestamp);
- assert.isUndefined(results.testEnvironment);
- assert.isUndefined(results.testRunner);
- });
+ };
+ axe.getReporter('v1')(
+ runResults,
+ { environmentData: environmentData },
+ function (results) {
+ assert.equal(results.myReporter, 'hello world');
+ assert.isUndefined(results.url);
+ assert.isUndefined(results.timestamp);
+ assert.isUndefined(results.testEnvironment);
+ assert.isUndefined(results.testRunner);
+ }
+ );
});
});
diff --git a/test/core/reporters/v2.js b/test/core/reporters/v2.js
index b7380a5953..29d13b6f64 100644
--- a/test/core/reporters/v2.js
+++ b/test/core/reporters/v2.js
@@ -1,4 +1,4 @@
-describe('reporters - v2', function() {
+describe('reporters - v2', function () {
'use strict';
var runResults,
_results = [
@@ -85,7 +85,7 @@ describe('reporters - v2', function() {
]
}
];
- beforeEach(function() {
+ beforeEach(function () {
runResults = JSON.parse(JSON.stringify(_results));
axe._load({
messages: {},
@@ -94,12 +94,12 @@ describe('reporters - v2', function() {
});
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should merge the runRules results into violations and passes', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should merge the runRules results into violations and passes', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.isObject(results);
assert.isArray(results.violations);
assert.lengthOf(results.violations, 1);
@@ -107,26 +107,26 @@ describe('reporters - v2', function() {
assert.lengthOf(results.passes, 1);
});
});
- it('should add the rule id to the rule result', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the rule id to the rule result', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.equal(results.violations[0].id, 'idkStuff');
assert.equal(results.passes[0].id, 'gimmeLabel');
});
});
- it('should add tags to the rule result', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add tags to the rule result', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.deepEqual(results.violations[0].tags, ['tag2']);
assert.deepEqual(results.passes[0].tags, ['tag1']);
});
});
- it('should add the rule help to the rule result', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the rule help to the rule result', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.isNotOk(results.violations[0].helpUrl);
assert.equal(results.passes[0].helpUrl, 'things');
});
});
- it('should add the html to the node data', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the html to the node data', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.equal(
@@ -136,8 +136,8 @@ describe('reporters - v2', function() {
assert.equal(results.passes[0].nodes[0].html, 'chimp');
});
});
- it('should add the target selector array to the node data', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the target selector array to the node data', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.ok(results.violations[0].nodes);
assert.equal(results.violations[0].nodes.length, 1);
assert.deepEqual(results.violations[0].nodes[0].target, [
@@ -147,22 +147,22 @@ describe('reporters - v2', function() {
]);
});
});
- it('should add the description to the rule result', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the description to the rule result', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.equal(results.violations[0].description, 'something more nifty');
assert.equal(results.passes[0].description, 'something nifty');
});
});
- it('should add the impact to the rule result', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add the impact to the rule result', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.equal(results.violations[0].impact, 'cats');
assert.equal(results.violations[0].nodes[0].impact, 'cats');
assert.isNotOk(results.passes[0].impact);
assert.isNotOk(results.passes[0].nodes[0].impact);
});
});
- it('should map relatedNodes', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should map relatedNodes', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.lengthOf(results.violations[0].nodes[0].all[0].relatedNodes, 1);
assert.equal(
results.violations[0].nodes[0].all[0].relatedNodes[0].target,
@@ -184,29 +184,33 @@ describe('reporters - v2', function() {
);
});
});
- it('should add environment data', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add environment data', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.isDefined(results.url);
assert.isDefined(results.timestamp);
assert.isDefined(results.testEnvironment);
assert.isDefined(results.testRunner);
});
});
- it('should add toolOptions property', function() {
- axe.getReporter('v2')(runResults, {}, function(results) {
+ it('should add toolOptions property', function () {
+ axe.getReporter('v2')(runResults, {}, function (results) {
assert.isDefined(results.toolOptions);
});
});
it('uses the environmentData option instead of environment data if specified', function () {
var environmentData = {
myReporter: 'hello world'
- }
- axe.getReporter('v2')(runResults, { environmentData: environmentData }, function(results) {
- assert.equal(results.myReporter, 'hello world');
- assert.isUndefined(results.url);
- assert.isUndefined(results.timestamp);
- assert.isUndefined(results.testEnvironment);
- assert.isUndefined(results.testRunner);
- });
+ };
+ axe.getReporter('v2')(
+ runResults,
+ { environmentData: environmentData },
+ function (results) {
+ assert.equal(results.myReporter, 'hello world');
+ assert.isUndefined(results.url);
+ assert.isUndefined(results.timestamp);
+ assert.isUndefined(results.testEnvironment);
+ assert.isUndefined(results.testRunner);
+ }
+ );
});
});
diff --git a/test/core/utils/aggregate.js b/test/core/utils/aggregate.js
index 83077b49db..9fb275fe2f 100644
--- a/test/core/utils/aggregate.js
+++ b/test/core/utils/aggregate.js
@@ -1,31 +1,31 @@
-describe('aggregate', function() {
+describe('aggregate', function () {
'use strict';
var map = ['youngling', 'padawan', 'knight', 'master', 'grand master'];
var values = ['knight', 'master', 'padawan'];
- it('takes a map, values array and initial value', function() {
+ it('takes a map, values array and initial value', function () {
assert.isFunction(axe.utils.aggregate);
assert.lengthOf(axe.utils.aggregate, 3);
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
axe.utils.aggregate(map, values, 'youngling');
});
});
- it('does not change the values array', function() {
+ it('does not change the values array', function () {
var copy = [].concat(values);
axe.utils.aggregate(map, values, 'youngling');
assert.deepEqual(values, copy);
});
- it('picks the value with the highest index in the map, from the list of values', function() {
+ it('picks the value with the highest index in the map, from the list of values', function () {
var result = axe.utils.aggregate(map, ['knight', 'master', 'youngling']);
assert.equal(result, 'master');
});
- it('considers the initial value in addition to the other values', function() {
+ it('considers the initial value in addition to the other values', function () {
var result = axe.utils.aggregate(
map,
['knight', 'master', 'youngling'],
@@ -34,7 +34,7 @@ describe('aggregate', function() {
assert.equal(result, 'grand master');
});
- it('ignores values not on the map', function() {
+ it('ignores values not on the map', function () {
var result = axe.utils.aggregate(
map,
['bounty hunter', 'sith lord'],
@@ -43,7 +43,7 @@ describe('aggregate', function() {
assert.equal(result, 'youngling');
});
- it('returns undefined if no value was found', function() {
+ it('returns undefined if no value was found', function () {
assert.isUndefined(axe.utils.aggregate(map, ['smugler', 'droid']));
});
});
diff --git a/test/core/utils/aggregateChecks.js b/test/core/utils/aggregateChecks.js
index 433800c2eb..997c4d9424 100644
--- a/test/core/utils/aggregateChecks.js
+++ b/test/core/utils/aggregateChecks.js
@@ -1,4 +1,4 @@
-describe('axe.utils.aggregateChecks', function() {
+describe('axe.utils.aggregateChecks', function () {
'use strict';
var FAIL = axe.constants.FAIL;
var PASS = axe.constants.PASS;
@@ -8,11 +8,11 @@ describe('axe.utils.aggregateChecks', function() {
// create an object of check results, padding input with defaults and
// wrapping arrays where required
function createTestCheckResults(node) {
- ['any', 'all', 'none'].forEach(function(type) {
+ ['any', 'all', 'none'].forEach(function (type) {
if (typeof node[type] === 'undefined') {
node[type] = [];
} else if (Array.isArray(node[type])) {
- node[type] = node[type].map(function(val) {
+ node[type] = node[type].map(function (val) {
if (typeof val !== 'object') {
return { result: val };
} else {
@@ -29,23 +29,23 @@ describe('axe.utils.aggregateChecks', function() {
return node;
}
- beforeEach(function() {
+ beforeEach(function () {
axe._load({});
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.aggregateChecks);
});
- it('Should be `inapplicable` when no results are given', function() {
+ it('Should be `inapplicable` when no results are given', function () {
var ruleResult = axe.utils.aggregateChecks(createTestCheckResults({}));
assert.equal(ruleResult.result, NA);
});
- it('sets result to cantTell when result is not a boolean', function() {
+ it('sets result to cantTell when result is not a boolean', function () {
var values = [undefined, null, 0, 'true', {}, NaN];
- values.forEach(function(value) {
+ values.forEach(function (value) {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [{ result: value }]
@@ -55,7 +55,7 @@ describe('axe.utils.aggregateChecks', function() {
});
});
- it('returns impact for fail and canttell', function() {
+ it('returns impact for fail and canttell', function () {
var failCheck = axe.utils.aggregateChecks(
createTestCheckResults({
any: [{ result: false, impact: 'serious' }]
@@ -71,7 +71,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(canttellCheck.impact, 'moderate');
});
- it('sets impact to null for pass', function() {
+ it('sets impact to null for pass', function () {
var passCheck = axe.utils.aggregateChecks(
createTestCheckResults({
any: [{ result: true, impact: 'serious' }]
@@ -80,8 +80,8 @@ describe('axe.utils.aggregateChecks', function() {
assert.isNull(passCheck.impact);
});
- describe('none', function() {
- it('gives result FAIL when any is true', function() {
+ describe('none', function () {
+ it('gives result FAIL when any is true', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
none: [false, true, undefined]
@@ -91,7 +91,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, FAIL);
});
- it('gives result CANTTELL when none is true and any is not a boolean', function() {
+ it('gives result CANTTELL when none is true and any is not a boolean', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
none: [undefined, false]
@@ -100,7 +100,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, CANTTELL);
});
- it('gives result PASS when all are FALSE', function() {
+ it('gives result PASS when all are FALSE', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
none: [false, false]
@@ -110,8 +110,8 @@ describe('axe.utils.aggregateChecks', function() {
});
});
- describe('any', function() {
- it('gives result PASS when any is true', function() {
+ describe('any', function () {
+ it('gives result PASS when any is true', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [undefined, true]
@@ -120,7 +120,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, PASS);
});
- it('gives result CANTTELL when none is true and any is not a bool', function() {
+ it('gives result CANTTELL when none is true and any is not a bool', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [undefined, false]
@@ -129,7 +129,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, CANTTELL);
});
- it('gives result FAIL when all are false', function() {
+ it('gives result FAIL when all are false', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [false, false]
@@ -139,8 +139,8 @@ describe('axe.utils.aggregateChecks', function() {
});
});
- describe('all', function() {
- it('gives result FAIL when any is false', function() {
+ describe('all', function () {
+ it('gives result FAIL when any is false', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
all: [false, true, undefined]
@@ -150,7 +150,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, FAIL);
});
- it('gives result CANTTELL when none is false and any is not a boolean', function() {
+ it('gives result CANTTELL when none is false and any is not a boolean', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
all: [undefined, true]
@@ -159,7 +159,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, CANTTELL);
});
- it('gives result PASS when all are true', function() {
+ it('gives result PASS when all are true', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
all: [true, true]
@@ -169,8 +169,8 @@ describe('axe.utils.aggregateChecks', function() {
});
});
- describe('combined', function() {
- it('gives result PASS when all are PASS', function() {
+ describe('combined', function () {
+ it('gives result PASS when all are PASS', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: true,
@@ -182,7 +182,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, PASS);
});
- it('gives result CANTTELL when none is FAIL and any is CANTTELL', function() {
+ it('gives result CANTTELL when none is FAIL and any is CANTTELL', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: 0,
@@ -193,7 +193,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, CANTTELL);
});
- it('gives result FAIL when any are FAIL', function() {
+ it('gives result FAIL when any are FAIL', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: 0,
@@ -204,7 +204,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.equal(checkResult.result, FAIL);
});
- it('ignores fail checks on any, if at least one passed', function() {
+ it('ignores fail checks on any, if at least one passed', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [false, undefined, true], // cantTell
@@ -216,7 +216,7 @@ describe('axe.utils.aggregateChecks', function() {
assert.lengthOf(checkResult.none, 1);
});
- it('includes cantTell checks from any if there are no fails', function() {
+ it('includes cantTell checks from any if there are no fails', function () {
var checkResult = axe.utils.aggregateChecks(
createTestCheckResults({
any: [undefined, undefined, false], // cantTell
diff --git a/test/core/utils/aggregateNodeResults.js b/test/core/utils/aggregateNodeResults.js
index aed5db2807..dfd2c60f06 100644
--- a/test/core/utils/aggregateNodeResults.js
+++ b/test/core/utils/aggregateNodeResults.js
@@ -1,4 +1,4 @@
-describe('axe.utils.aggregateNodeResults', function() {
+describe('axe.utils.aggregateNodeResults', function () {
'use strict';
var FAIL = 'failed';
var PASS = 'passed';
@@ -9,12 +9,12 @@ describe('axe.utils.aggregateNodeResults', function() {
// wrapping arrays where required
function createTestResults() {
var args = [].slice.call(arguments);
- return args.map(function(node) {
- ['any', 'all', 'none'].forEach(function(type) {
+ return args.map(function (node) {
+ ['any', 'all', 'none'].forEach(function (type) {
if (typeof node[type] === 'undefined') {
node[type] = [];
} else if (Array.isArray(node[type])) {
- node[type] = node[type].map(function(val) {
+ node[type] = node[type].map(function (val) {
if (typeof val !== 'object') {
return { result: val };
} else {
@@ -32,20 +32,20 @@ describe('axe.utils.aggregateNodeResults', function() {
});
}
- beforeEach(function() {
+ beforeEach(function () {
axe._load({});
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.aggregateNodeResults);
});
- it('Should be `inapplicable` when no results are given', function() {
+ it('Should be `inapplicable` when no results are given', function () {
var ruleResult = axe.utils.aggregateNodeResults([]);
assert.equal(ruleResult.result, INAPPLICABLE);
});
- it('should assign FAIL to ruleResult over PASS', function() {
+ it('should assign FAIL to ruleResult over PASS', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({ all: false }, { all: true }, { all: true })
);
@@ -54,7 +54,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.lengthOf(ruleResult.passes, 2);
});
- it('should assign FAIL to ruleResult over CANTTELL', function() {
+ it('should assign FAIL to ruleResult over CANTTELL', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({ all: false }, { all: 0 }, { all: true })
);
@@ -64,7 +64,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.lengthOf(ruleResult.passes, 1);
});
- it('should assign PASS to ruleResult if there are only passing checks', function() {
+ it('should assign PASS to ruleResult if there are only passing checks', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({ all: true }, { all: true }, { all: true })
);
@@ -73,7 +73,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.lengthOf(ruleResult.violations, 0);
});
- it('should assign FAIL if there are no passing anys checks', function() {
+ it('should assign FAIL if there are no passing anys checks', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({ any: false }, { any: false }, { any: false })
);
@@ -82,7 +82,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.lengthOf(ruleResult.passes, 0);
});
- it('should assign CANTTELL over PASS', function() {
+ it('should assign CANTTELL over PASS', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({ all: true }, { all: 0 }, { all: 0 })
);
@@ -91,7 +91,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.lengthOf(ruleResult.passes, 1);
});
- it('should provide impact on incomplete', function() {
+ it('should provide impact on incomplete', function () {
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults({
none: { result: undefined, impact: 'serious' }
@@ -100,7 +100,7 @@ describe('axe.utils.aggregateNodeResults', function() {
assert.equal(ruleResult.impact, 'serious');
});
- it('should raise the highest "raisedMetadata" on failing checks', function() {
+ it('should raise the highest "raisedMetadata" on failing checks', function () {
/*eslint indent:0 */
var ruleResult = axe.utils.aggregateNodeResults(
createTestResults(
diff --git a/test/core/utils/aggregateResult.js b/test/core/utils/aggregateResult.js
index 89fc439501..5eb70d9b6e 100644
--- a/test/core/utils/aggregateResult.js
+++ b/test/core/utils/aggregateResult.js
@@ -1,4 +1,4 @@
-describe('axe.utils.aggregateResult', function() {
+describe('axe.utils.aggregateResult', function () {
'use strict';
var results,
@@ -148,11 +148,11 @@ describe('axe.utils.aggregateResult', function() {
}
];
- beforeEach(function() {
+ beforeEach(function () {
results = JSON.parse(JSON.stringify(_results));
});
- it('creates an object with arrays as properties for each result', function() {
+ it('creates an object with arrays as properties for each result', function () {
var resultObject = axe.utils.aggregateResult(results);
assert.isArray(resultObject.passes);
@@ -161,7 +161,7 @@ describe('axe.utils.aggregateResult', function() {
assert.isArray(resultObject.inapplicable);
});
- it('copies failures and passes to their respective arrays on the result object', function() {
+ it('copies failures and passes to their respective arrays on the result object', function () {
// insert 1 pass and 1 fail
var input = [results[0], results[1]];
var resultObject = axe.utils.aggregateResult(input);
@@ -180,7 +180,7 @@ describe('axe.utils.aggregateResult', function() {
assert.notEqual(resultObject.violations[0].nodes, input[1].violations);
});
- it('creates a duplicate of the result for each outcome it has', function() {
+ it('creates a duplicate of the result for each outcome it has', function () {
// insert 1 fail, containing a pass, a fail and a cantTell result
var input = [results[2]];
var resultObject = axe.utils.aggregateResult(input);
@@ -196,7 +196,7 @@ describe('axe.utils.aggregateResult', function() {
assert.deepEqual(resultObject.incomplete[0].nodes, input[0].incomplete);
});
- it('moves inapplicable results only to the inapplicable array', function() {
+ it('moves inapplicable results only to the inapplicable array', function () {
// insert 1 fail, containing a pass, a fail and a cantTell result
var input = [results[3]];
var resultObject = axe.utils.aggregateResult(input);
diff --git a/test/core/utils/are-styles-set.js b/test/core/utils/are-styles-set.js
index d9b3aecba0..3d4729d6f1 100644
--- a/test/core/utils/are-styles-set.js
+++ b/test/core/utils/are-styles-set.js
@@ -1,18 +1,18 @@
/*global axe*/
-describe('axe.utils.areStylesSet', function() {
+describe('axe.utils.areStylesSet', function () {
'use strict';
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.areStylesSet);
});
- it('should return true if `display:none` is set', function() {
+ it('should return true if `display:none` is set', function () {
fixture.innerHTML =
'Display None
';
@@ -26,7 +26,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `display:none` is set', function() {
+ it('should return true if `display:none` is set', function () {
fixture.innerHTML =
'';
@@ -40,7 +40,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `visibility:hidden` is set', function() {
+ it('should return true if `visibility:hidden` is set', function () {
fixture.innerHTML =
'';
@@ -54,7 +54,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `visibility:hidden` is set', function() {
+ it('should return true if `visibility:hidden` is set', function () {
fixture.innerHTML =
'Display None
';
@@ -68,7 +68,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `visibility:hidden` is set', function() {
+ it('should return true if `visibility:hidden` is set', function () {
fixture.innerHTML =
'Display None
';
@@ -91,7 +91,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `visibility:hidden` is set', function() {
+ it('should return true if `visibility:hidden` is set', function () {
fixture.innerHTML =
'';
@@ -114,7 +114,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return true if `display:none` is set', function() {
+ it('should return true if `display:none` is set', function () {
fixture.innerHTML =
'';
@@ -137,7 +137,7 @@ describe('axe.utils.areStylesSet', function() {
);
});
- it('should return false if nothing is set', function() {
+ it('should return false if nothing is set', function () {
fixture.innerHTML =
'';
diff --git a/test/core/utils/assert.js b/test/core/utils/assert.js
index 03f794fb9e..1431769101 100644
--- a/test/core/utils/assert.js
+++ b/test/core/utils/assert.js
@@ -1,6 +1,6 @@
-describe('axe.utils.assert', function() {
- it('does nothing when passed a truthy value', function() {
- assert.doesNotThrow(function() {
+describe('axe.utils.assert', function () {
+ it('does nothing when passed a truthy value', function () {
+ assert.doesNotThrow(function () {
axe.utils.assert(true);
axe.utils.assert('foo');
axe.utils.assert(123);
@@ -9,22 +9,22 @@ describe('axe.utils.assert', function() {
});
});
- it('throws an error when passed a falsey value', function() {
- assert.throws(function() {
+ it('throws an error when passed a falsey value', function () {
+ assert.throws(function () {
axe.utils.assert(false);
});
- assert.throws(function() {
+ assert.throws(function () {
axe.utils.assert(0);
});
- assert.throws(function() {
+ assert.throws(function () {
axe.utils.assert(null);
});
- assert.throws(function() {
+ assert.throws(function () {
axe.utils.assert(undefined);
});
});
- it('sets second argument as the error message', function() {
+ it('sets second argument as the error message', function () {
var message = 'Something went wrong';
try {
axe.utils.assert(false, message);
diff --git a/test/core/utils/check-helper.js b/test/core/utils/check-helper.js
index a5c37b83b2..c4608684e3 100644
--- a/test/core/utils/check-helper.js
+++ b/test/core/utils/check-helper.js
@@ -1,31 +1,31 @@
-describe('axe.utils.checkHelper', function() {
+describe('axe.utils.checkHelper', function () {
'use strict';
var DqElement = axe.utils.DqElement;
function noop() {}
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.checkHelper);
});
- it('should accept 4 named parameters', function() {
+ it('should accept 4 named parameters', function () {
assert.lengthOf(axe.utils.checkHelper, 4);
});
- it('should return an object', function() {
+ it('should return an object', function () {
assert.isObject(axe.utils.checkHelper());
});
- describe('return value', function() {
- describe('async', function() {
- it('should set isAsync property on returned object to `true` when called', function() {
+ describe('return value', function () {
+ describe('async', function () {
+ it('should set isAsync property on returned object to `true` when called', function () {
var target = {},
helper = axe.utils.checkHelper(target, noop);
helper.async();
assert.isTrue(helper.isAsync);
});
- it('should call the third parameter of `axe.utils.checkHelper` when invoked', function() {
+ it('should call the third parameter of `axe.utils.checkHelper` when invoked', function () {
function fn() {
success = true;
}
@@ -38,7 +38,7 @@ describe('axe.utils.checkHelper', function() {
assert.isTrue(success);
});
- it('should call the fourth parameter of `axe.utils.checkHelper` when returning an error', function() {
+ it('should call the fourth parameter of `axe.utils.checkHelper` when returning an error', function () {
var success = false;
function reject(e) {
success = true;
@@ -52,8 +52,8 @@ describe('axe.utils.checkHelper', function() {
assert.isTrue(success);
});
});
- describe('data', function() {
- it('should set data property on target when called', function() {
+ describe('data', function () {
+ it('should set data property on target when called', function () {
var target = {},
expected = { monkeys: 'bananas' },
helper = axe.utils.checkHelper(target, noop);
@@ -63,12 +63,12 @@ describe('axe.utils.checkHelper', function() {
assert.equal(target.data, expected);
});
});
- describe('relatedNodes', function() {
+ describe('relatedNodes', function () {
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should accept NodeList', function() {
+ it('should accept NodeList', function () {
fixture.innerHTML = '
';
var target = {},
helper = axe.utils.checkHelper(target, noop);
@@ -79,7 +79,7 @@ describe('axe.utils.checkHelper', function() {
assert.equal(target.relatedNodes[0].element, fixture.children[0]);
assert.equal(target.relatedNodes[1].element, fixture.children[1]);
});
- it('should accept a single Node', function() {
+ it('should accept a single Node', function () {
fixture.innerHTML = '
';
var target = {},
helper = axe.utils.checkHelper(target, noop);
@@ -88,7 +88,7 @@ describe('axe.utils.checkHelper', function() {
assert.instanceOf(target.relatedNodes[0], DqElement);
assert.equal(target.relatedNodes[0].element, fixture.firstChild);
});
- it('should accept an Array', function() {
+ it('should accept an Array', function () {
fixture.innerHTML = '
';
var target = {},
helper = axe.utils.checkHelper(target, noop);
@@ -99,7 +99,7 @@ describe('axe.utils.checkHelper', function() {
assert.equal(target.relatedNodes[0].element, fixture.children[0]);
assert.equal(target.relatedNodes[1].element, fixture.children[1]);
});
- it('should accept an array-like Object', function() {
+ it('should accept an array-like Object', function () {
fixture.innerHTML = '
';
var target = {},
helper = axe.utils.checkHelper(target, noop);
@@ -115,13 +115,13 @@ describe('axe.utils.checkHelper', function() {
assert.equal(target.relatedNodes[0].element, fixture.children[0]);
assert.equal(target.relatedNodes[1].element, fixture.children[1]);
});
- it('should noop for non-node-like objects', function() {
+ it('should noop for non-node-like objects', function () {
var target = {},
helper = axe.utils.checkHelper(target, noop);
var nodes = new axe.SerialVirtualNode({
nodeName: 'div'
});
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
helper.relatedNodes(nodes);
});
assert.lengthOf(target.relatedNodes, 0);
diff --git a/test/core/utils/clone.js b/test/core/utils/clone.js
index 8e57545445..583f9bb9fe 100644
--- a/test/core/utils/clone.js
+++ b/test/core/utils/clone.js
@@ -1,8 +1,8 @@
-describe('utils.clone', function() {
+describe('utils.clone', function () {
'use strict';
var clone = axe.utils.clone;
- it('should clone an object', function() {
+ it('should clone an object', function () {
var obj = {
cats: true,
dogs: 2,
@@ -19,7 +19,7 @@ describe('utils.clone', function() {
assert.deepEqual(c.fish, [0, 1, 2]);
});
- it('should clone nested objects', function() {
+ it('should clone nested objects', function () {
var obj = {
cats: {
fred: 1,
@@ -54,12 +54,12 @@ describe('utils.clone', function() {
assert.deepEqual(c.fish, [0, 1, 2]);
});
- it('should clone objects with methods', function() {
+ it('should clone objects with methods', function () {
var obj = {
- cats: function() {
+ cats: function () {
return 'meow';
},
- dogs: function() {
+ dogs: function () {
return 'woof';
}
};
@@ -68,23 +68,23 @@ describe('utils.clone', function() {
assert.strictEqual(obj.cats, c.cats);
assert.strictEqual(obj.dogs, c.dogs);
- obj.cats = function() {};
- obj.dogs = function() {};
+ obj.cats = function () {};
+ obj.dogs = function () {};
assert.notStrictEqual(obj.cats, c.cats);
assert.notStrictEqual(obj.dogs, c.dogs);
});
- it('should clone prototypes', function() {
+ it('should clone prototypes', function () {
function Cat(name) {
this.name = name;
}
- Cat.prototype.meow = function() {
+ Cat.prototype.meow = function () {
return 'meow';
};
- Cat.prototype.bark = function() {
+ Cat.prototype.bark = function () {
return 'cats dont bark';
};
diff --git a/test/core/utils/closest.js b/test/core/utils/closest.js
index 4e19bffaa0..8772135198 100644
--- a/test/core/utils/closest.js
+++ b/test/core/utils/closest.js
@@ -1,14 +1,14 @@
-describe('utils.closest', function() {
+describe('utils.closest', function () {
var closest = axe.utils.closest;
var fixture = document.querySelector('#fixture');
var queryFixture = axe.testUtils.queryFixture;
var shadowSupported = axe.testUtils.shadowSupport.v1;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should find the current node', function() {
+ it('should find the current node', function () {
var virtualNode = queryFixture(
''
);
@@ -16,7 +16,7 @@ describe('utils.closest', function() {
assert.equal(closestNode, virtualNode);
});
- it('should find a parent node', function() {
+ it('should find a parent node', function () {
var virtualNode = queryFixture(
'foo
'
);
@@ -25,7 +25,7 @@ describe('utils.closest', function() {
assert.equal(closestNode, axe.utils.getNodeFromTree(parent));
});
- it('should find an ancestor node', function() {
+ it('should find an ancestor node', function () {
var virtualNode = queryFixture(
'foo
'
);
@@ -34,7 +34,7 @@ describe('utils.closest', function() {
assert.equal(closestNode, axe.utils.getNodeFromTree(parent));
});
- it('should return null if no ancestor is found', function() {
+ it('should return null if no ancestor is found', function () {
var virtualNode = queryFixture(
''
);
@@ -42,7 +42,7 @@ describe('utils.closest', function() {
assert.isNull(closestNode);
});
- it('should error if tree is not complete', function() {
+ it('should error if tree is not complete', function () {
var virtualNode = queryFixture('foo
');
virtualNode.parent = undefined;
@@ -53,7 +53,7 @@ describe('utils.closest', function() {
assert.throws(fn);
});
- it('should not error if tree is complete', function() {
+ it('should not error if tree is complete', function () {
var virtualNode = queryFixture('foo
');
virtualNode.parent = null;
@@ -64,7 +64,7 @@ describe('utils.closest', function() {
assert.doesNotThrow(fn);
});
- (shadowSupported ? it : xit)('should support shadow dom', function() {
+ (shadowSupported ? it : xit)('should support shadow dom', function () {
fixture.innerHTML = '
';
var root = fixture.firstChild.attachShadow({ mode: 'open' });
diff --git a/test/core/utils/collect-results-from-frames.js b/test/core/utils/collect-results-from-frames.js
index 70aade1881..6cb3193c3a 100644
--- a/test/core/utils/collect-results-from-frames.js
+++ b/test/core/utils/collect-results-from-frames.js
@@ -1,9 +1,9 @@
-describe('axe.utils.collectResultsFromFrames', function() {
+describe('axe.utils.collectResultsFromFrames', function () {
'use strict';
var Context = axe._thisWillBeDeletedDoNotUse.base.Context;
var fixture = document.getElementById('fixture');
- var noop = function() {};
+ var noop = function () {};
var origSetTimeout = window.setTimeout;
function contextSetup(scope) {
@@ -14,18 +14,18 @@ describe('axe.utils.collectResultsFromFrames', function() {
return context;
}
- afterEach(function() {
+ afterEach(function () {
window.setTimeout = origSetTimeout;
fixture.innerHTML = '';
axe._tree = undefined;
axe._selectorData = undefined;
});
- it('should timeout the ping request after 500ms', function(done) {
+ it('should timeout the ping request after 500ms', function (done) {
this.timeout = 1000;
var timeoutSet = false;
- window.setTimeout = function(fn, to) {
+ window.setTimeout = function (fn, to) {
if (to === 500) {
timeoutSet = true;
fn();
@@ -37,7 +37,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
};
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
axe.utils.collectResultsFromFrames(
@@ -45,7 +45,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
{},
'stuff',
'morestuff',
- function() {
+ function () {
assert.isTrue(timeoutSet);
done();
},
@@ -58,11 +58,11 @@ describe('axe.utils.collectResultsFromFrames', function() {
fixture.appendChild(frame);
});
- it('should override the ping timeout with `options.pingWaitTime`, if provided', function(done) {
+ it('should override the ping timeout with `options.pingWaitTime`, if provided', function (done) {
this.timeout = 1000;
var timeoutSet = false;
- window.setTimeout = function(fn, to) {
+ window.setTimeout = function (fn, to) {
if (to === 90000) {
timeoutSet = true;
fn();
@@ -74,7 +74,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
};
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
var params = { pingWaitTime: 90000 };
@@ -83,7 +83,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
params,
'stuff',
'morestuff',
- function() {
+ function () {
assert.isTrue(timeoutSet);
done();
},
@@ -96,8 +96,8 @@ describe('axe.utils.collectResultsFromFrames', function() {
fixture.appendChild(frame);
});
- it('should timeout the start request after 60s', function(done) {
- window.setTimeout = function(fn, to) {
+ it('should timeout the start request after 60s', function (done) {
+ window.setTimeout = function (fn, to) {
if (to === 60000) {
assert.ok('timeout set');
fn();
@@ -109,7 +109,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
};
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
axe.utils.collectResultsFromFrames(
context,
@@ -117,7 +117,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
'stuff',
'morestuff',
noop,
- function(err) {
+ function (err) {
assert.instanceOf(err, Error);
assert.equal(err.message.split(/: /)[0], 'Axe in frame timed out');
done();
@@ -130,8 +130,8 @@ describe('axe.utils.collectResultsFromFrames', function() {
fixture.appendChild(frame);
});
- it('should override the start timeout with `options.frameWaitTime`, if provided', function(done) {
- window.setTimeout = function(fn, to) {
+ it('should override the start timeout with `options.frameWaitTime`, if provided', function (done) {
+ window.setTimeout = function (fn, to) {
if (to === 90000) {
assert.ok('timeout set');
fn();
@@ -143,7 +143,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
};
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
var params = { frameWaitTime: 90000 };
@@ -153,7 +153,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
'stuff',
'morestuff',
noop,
- function(err) {
+ function (err) {
assert.instanceOf(err, Error);
assert.equal(err.message.split(/: /)[0], 'Axe in frame timed out');
done();
@@ -166,7 +166,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
fixture.appendChild(frame);
});
- it('should not throw given a recursive iframe', function(done) {
+ it('should not throw given a recursive iframe', function (done) {
axe._load({
rules: [
{
@@ -175,7 +175,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
any: [
{
id: 'iframe',
- evaluate: function() {
+ evaluate: function () {
return true;
}
}
@@ -186,7 +186,7 @@ describe('axe.utils.collectResultsFromFrames', function() {
});
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
axe.utils.collectResultsFromFrames(
@@ -194,10 +194,10 @@ describe('axe.utils.collectResultsFromFrames', function() {
{},
'rules',
'morestuff',
- function() {
+ function () {
done();
},
- function(e) {
+ function (e) {
assert.ok(false, e);
done();
}
@@ -209,19 +209,19 @@ describe('axe.utils.collectResultsFromFrames', function() {
fixture.appendChild(frame);
});
- it('returns errors send from the frame', function(done) {
+ it('returns errors send from the frame', function (done) {
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var context = contextSetup(document);
axe.utils.collectResultsFromFrames(
context,
{},
'rules',
'morestuff',
- function() {
+ function () {
done(new Error('Should not be called'));
},
- function(err) {
+ function (err) {
assert.instanceOf(err, Error);
assert.equal(err.message.split(/\n/)[0], 'error in axe.throw');
done();
diff --git a/test/core/utils/contains.js b/test/core/utils/contains.js
index e9e0ea1cef..a9d52f80b4 100644
--- a/test/core/utils/contains.js
+++ b/test/core/utils/contains.js
@@ -1,23 +1,23 @@
-describe('axe.utils.contains', function() {
+describe('axe.utils.contains', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowSupported = axe.testUtils.shadowSupport.v1;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should first check contains', function() {
+ it('should first check contains', function () {
var success = false,
node2 = { actualNode: 'not really a node but it doesnt matter' },
node1 = {
actualNode: {
- contains: function(n2) {
+ contains: function (n2) {
success = true;
assert.deepEqual(n2, node2.actualNode);
},
- compareDocumentPosition: function() {
+ compareDocumentPosition: function () {
success = false;
assert.ok(false, 'should not be called');
}
@@ -28,12 +28,12 @@ describe('axe.utils.contains', function() {
assert.isTrue(success);
});
- it('should fallback to compareDocumentPosition', function() {
+ it('should fallback to compareDocumentPosition', function () {
var success = false,
node2 = { actualNode: 'not really a node but it doesnt matter' },
node1 = {
actualNode: {
- compareDocumentPosition: function(n2) {
+ compareDocumentPosition: function (n2) {
success = true;
assert.deepEqual(n2, node2.actualNode);
}
@@ -44,11 +44,11 @@ describe('axe.utils.contains', function() {
assert.isTrue(success);
});
- it('should compareDocumentPosition against bitwise & 16', function() {
+ it('should compareDocumentPosition against bitwise & 16', function () {
var node2 = { actualNode: 'not really a node but it doesnt matter' },
node1 = {
actualNode: {
- compareDocumentPosition: function() {
+ compareDocumentPosition: function () {
return 20;
}
}
@@ -57,7 +57,7 @@ describe('axe.utils.contains', function() {
assert.isTrue(axe.utils.contains(node1, node2));
});
- it('should fallback to parent lookup', function() {
+ it('should fallback to parent lookup', function () {
var node1 = {};
var node2 = {
parent: node1
@@ -68,7 +68,7 @@ describe('axe.utils.contains', function() {
(shadowSupported ? it : xit)(
'should work when the child is inside shadow DOM',
- function() {
+ function () {
var tree, node1, node2;
function createContentContains() {
@@ -98,7 +98,7 @@ describe('axe.utils.contains', function() {
(shadowSupported ? it : xit)(
'should work with slotted elements inside shadow DOM',
- function() {
+ function () {
var tree, node1, node2;
function createContentSlotted() {
@@ -123,7 +123,7 @@ describe('axe.utils.contains', function() {
}
);
- it('should work', function() {
+ it('should work', function () {
fixture.innerHTML = '';
var inner = axe.utils.getFlattenedTree(document.getElementById('inner'))[0];
var outer = axe.utils.getFlattenedTree(document.getElementById('outer'))[0];
diff --git a/test/core/utils/deep-merge.js b/test/core/utils/deep-merge.js
index 6145d9ebba..27863c68f2 100644
--- a/test/core/utils/deep-merge.js
+++ b/test/core/utils/deep-merge.js
@@ -1,7 +1,7 @@
-describe('utils.deepMerge', function() {
+describe('utils.deepMerge', function () {
var deepMerge = axe.utils.deepMerge;
- it('should merge two objects', function() {
+ it('should merge two objects', function () {
var obj1 = { a: 'one' };
var obj2 = { b: 'two' };
@@ -11,7 +11,7 @@ describe('utils.deepMerge', function() {
});
});
- it('should not modify the objects', function() {
+ it('should not modify the objects', function () {
var obj1 = { a: 'one' };
var obj2 = { a: 'two' };
deepMerge(obj1, obj2);
@@ -20,7 +20,7 @@ describe('utils.deepMerge', function() {
assert.deepEqual(obj2, { a: 'two' });
});
- it('should return a new object', function() {
+ it('should return a new object', function () {
var obj1 = { a: 'one' };
var obj2 = { a: 'two' };
var obj3 = deepMerge(obj1, obj2);
@@ -29,14 +29,14 @@ describe('utils.deepMerge', function() {
assert.notStrictEqual(obj2, obj3);
});
- it('should not merge arrays', function() {
+ it('should not merge arrays', function () {
var obj1 = { a: ['one', 'two'] };
var obj2 = { a: ['three'] };
assert.deepEqual(deepMerge(obj1, obj2), { a: ['three'] });
});
- it('should merge nested objects', function() {
+ it('should merge nested objects', function () {
var obj1 = { a: { a: ['one'] } };
var obj2 = { a: { a: ['one', 'two'], b: 'three' } };
@@ -48,7 +48,7 @@ describe('utils.deepMerge', function() {
});
});
- it('should accept multiple objects', function() {
+ it('should accept multiple objects', function () {
var obj1 = { a: { a: ['one'] } };
var obj2 = { a: { a: ['one', 'two'], b: 'three' } };
var obj3 = { a: { b: 'four' }, b: 'five' };
@@ -62,10 +62,10 @@ describe('utils.deepMerge', function() {
});
});
- it('should handle bad sources', function() {
+ it('should handle bad sources', function () {
var obj;
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
obj = deepMerge(null, undefined, true, 'one', ['a', 'b'], 1, { a: 'b' });
});
assert.deepEqual(obj, { a: 'b' });
diff --git a/test/core/utils/element-matches.js b/test/core/utils/element-matches.js
index 340a8bfd20..728f59943a 100644
--- a/test/core/utils/element-matches.js
+++ b/test/core/utils/element-matches.js
@@ -1,10 +1,10 @@
-describe('utils.matchesSelector', function() {
+describe('utils.matchesSelector', function () {
'use strict';
var matchesSelector = axe.utils.matchesSelector;
function mockMethod(method, returnValue) {
var result = {};
- result[method] = function() {
+ result[method] = function () {
return returnValue;
};
result.ownerDocument = {
@@ -14,12 +14,12 @@ describe('utils.matchesSelector', function() {
}
}
};
- result.ownerDocument.defaultView.Element.prototype[method] = function() {};
+ result.ownerDocument.defaultView.Element.prototype[method] = function () {};
return result;
}
- it('should check the prototype of the Element object for matching methods', function() {
+ it('should check the prototype of the Element object for matching methods', function () {
assert.equal(matchesSelector(mockMethod('matches', 'test1')), 'test1');
assert.equal(
matchesSelector(mockMethod('matchesSelector', 'test2')),
@@ -39,7 +39,7 @@ describe('utils.matchesSelector', function() {
);
});
- it('should actually work', function() {
+ it('should actually work', function () {
var target,
fixture = document.getElementById('fixture');
@@ -50,7 +50,7 @@ describe('utils.matchesSelector', function() {
fixture.innerHTML = '';
});
- it('should return false if the element does not have a matching method', function() {
+ it('should return false if the element does not have a matching method', function () {
var target,
fixture = document.getElementById('fixture');
diff --git a/test/core/utils/escape-selector.js b/test/core/utils/escape-selector.js
index f5fc8e90c6..bc54614272 100644
--- a/test/core/utils/escape-selector.js
+++ b/test/core/utils/escape-selector.js
@@ -1,8 +1,8 @@
-describe('utils.escapeSelector', function() {
+describe('utils.escapeSelector', function () {
'use strict';
var escapeSelector = axe.utils.escapeSelector;
- it('leaves characters that do not need to escape alone', function() {
+ it('leaves characters that do not need to escape alone', function () {
assert.equal(escapeSelector('a0b'), 'a0b');
assert.equal(escapeSelector('a1b'), 'a1b');
assert.equal(escapeSelector('a2b'), 'a2b');
@@ -24,13 +24,13 @@ describe('utils.escapeSelector', function() {
);
});
- it('escapes null characters', function() {
+ it('escapes null characters', function () {
assert.equal(escapeSelector('\0'), '\uFFFD');
assert.equal(escapeSelector('a\0'), 'a\uFFFD');
assert.equal(escapeSelector('a\0b'), 'a\uFFFDb');
});
- it('stringifies non-string characters', function() {
+ it('stringifies non-string characters', function () {
assert.equal(escapeSelector(), 'undefined');
assert.equal(escapeSelector(true), 'true');
assert.equal(escapeSelector(false), 'false');
@@ -38,7 +38,7 @@ describe('utils.escapeSelector', function() {
assert.equal(escapeSelector(''), '');
});
- it('escapes strings starting with a number', function() {
+ it('escapes strings starting with a number', function () {
assert.equal(escapeSelector('0a'), '\\30 a');
assert.equal(escapeSelector('1a'), '\\31 a');
assert.equal(escapeSelector('2a'), '\\32 a');
@@ -51,13 +51,13 @@ describe('utils.escapeSelector', function() {
assert.equal(escapeSelector('9a'), '\\39 a');
});
- it('only escapes "-" when before a number, or on its own', function() {
+ it('only escapes "-" when before a number, or on its own', function () {
assert.equal(escapeSelector('-123'), '-\\31 23');
assert.equal(escapeSelector('-'), '\\-');
assert.equal(escapeSelector('--a'), '--a');
});
- it('escapes characters staring with a negative number', function() {
+ it('escapes characters staring with a negative number', function () {
assert.equal(escapeSelector('-0a'), '-\\30 a');
assert.equal(escapeSelector('-1a'), '-\\31 a');
assert.equal(escapeSelector('-2a'), '-\\32 a');
@@ -70,7 +70,7 @@ describe('utils.escapeSelector', function() {
assert.equal(escapeSelector('-9a'), '-\\39 a');
});
- it('escapes hex character codes', function() {
+ it('escapes hex character codes', function () {
assert.equal(escapeSelector('\x80\x2D\x5F\xA9'), '\x80\x2D\x5F\xA9');
assert.equal(escapeSelector('\xA0\xA1\xA2'), '\xA0\xA1\xA2');
diff --git a/test/core/utils/extend-meta-data.js b/test/core/utils/extend-meta-data.js
index d112eea00a..ff16abac5d 100644
--- a/test/core/utils/extend-meta-data.js
+++ b/test/core/utils/extend-meta-data.js
@@ -1,7 +1,7 @@
-describe('axe.utils.extend', function() {
+describe('axe.utils.extend', function () {
'use strict';
- it('should merge properties', function() {
+ it('should merge properties', function () {
var src = {
cats: 'fail',
dogs: 'fail'
@@ -16,13 +16,13 @@ describe('axe.utils.extend', function() {
assert.equal(src.dogs, 'woof');
});
- it('should execute any found functions', function() {
+ it('should execute any found functions', function () {
var src = {
cats: 'fail',
dogs: 'fail'
};
axe.utils.extendMetaData(src, {
- cats: function(ctxt) {
+ cats: function (ctxt) {
assert.equal(ctxt, src);
return 'meow';
},
@@ -32,13 +32,13 @@ describe('axe.utils.extend', function() {
assert.equal(src.cats, 'meow');
assert.equal(src.dogs, 'woof');
});
- it('should catch exceptions in functions and default to `null`', function() {
+ it('should catch exceptions in functions and default to `null`', function () {
var src = {
cats: 'fail',
dogs: 'fail'
};
axe.utils.extendMetaData(src, {
- cats: function() {
+ cats: function () {
throw new Error('hehe');
},
dogs: 'woof'
diff --git a/test/core/utils/filter-html-attrs.js b/test/core/utils/filter-html-attrs.js
index 300bf5b279..dd208871d3 100644
--- a/test/core/utils/filter-html-attrs.js
+++ b/test/core/utils/filter-html-attrs.js
@@ -1,43 +1,43 @@
-describe('axe.utils.filterHtmlAttrs', function() {
+describe('axe.utils.filterHtmlAttrs', function () {
'use strict';
var fixture = document.querySelector('#fixture');
var filterHtmlAttrs = axe.utils.filterHtmlAttrs;
var html, expected;
- beforeEach(function() {
+ beforeEach(function () {
fixture.innerHTML =
' My Label ';
html = fixture.firstChild;
expected = ' My Label ';
});
- it('should return string if no attributes are passed', function() {
+ it('should return string if no attributes are passed', function () {
assert.equal(filterHtmlAttrs(html), html);
});
- it('should filter attribute if exists', function() {
+ it('should filter attribute if exists', function () {
assert.equal(filterHtmlAttrs(html, { type: true }).outerHTML, expected);
});
- it('should filter attribute if matches CSS selector', function() {
+ it('should filter attribute if matches CSS selector', function () {
assert.equal(filterHtmlAttrs(html, { type: 'input' }).outerHTML, expected);
});
- it('should not filter attribute if does not match value', function() {
+ it('should not filter attribute if does not match value', function () {
assert.equal(
filterHtmlAttrs(html, { type: 'div' }).outerHTML,
html.outerHTML
);
});
- it('should not change the original element', function() {
+ it('should not change the original element', function () {
var outerHTML = html.outerHTML;
assert.isTrue(filterHtmlAttrs(html, { type: true }) !== html);
assert.equal(html.outerHTML, outerHTML);
});
- it('should filter multiple attributes', function() {
+ it('should filter multiple attributes', function () {
assert.equal(
filterHtmlAttrs(html, {
type: true,
diff --git a/test/core/utils/finalize-result.js b/test/core/utils/finalize-result.js
index d36e51275e..10c9b87c68 100644
--- a/test/core/utils/finalize-result.js
+++ b/test/core/utils/finalize-result.js
@@ -1,22 +1,22 @@
-describe('axe.utils.finalizeRuleResult', function() {
+describe('axe.utils.finalizeRuleResult', function () {
'use strict';
var original = axe._audit;
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = {
rules: []
};
});
- after(function() {
+ after(function () {
axe._audit = original;
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.finalizeRuleResult);
});
- it('returns the first param object', function() {
+ it('returns the first param object', function () {
var goingIn = {
nodes: []
};
@@ -25,7 +25,7 @@ describe('axe.utils.finalizeRuleResult', function() {
assert.equal(goingIn, comingOut);
});
- it('assigns impact if rule.impact is defined', function() {
+ it('assigns impact if rule.impact is defined', function () {
axe._audit = {
rules: [{ id: 'foo', impact: 'critical' }]
};
@@ -51,7 +51,7 @@ describe('axe.utils.finalizeRuleResult', function() {
assert.equal(output.violations[0].any[0].impact, 'critical');
});
- it('leaves impact as null when rule.impact is defined', function() {
+ it('leaves impact as null when rule.impact is defined', function () {
axe._audit = {
rules: [{ id: 'foo', impact: 'critical' }]
};
diff --git a/test/core/utils/find-by.js b/test/core/utils/find-by.js
index 1e41cc3111..79911a6ff8 100644
--- a/test/core/utils/find-by.js
+++ b/test/core/utils/find-by.js
@@ -1,7 +1,7 @@
-describe('axe.utils.findBy', function() {
+describe('axe.utils.findBy', function () {
'use strict';
- it('should find the first matching object', function() {
+ it('should find the first matching object', function () {
var array = [
{
id: 'monkeys',
@@ -19,7 +19,7 @@ describe('axe.utils.findBy', function() {
assert.equal(axe.utils.findBy(array, 'id', 'monkeys'), array[0]);
});
- it('should return undefined with no match', function() {
+ it('should return undefined with no match', function () {
var array = [
{
id: 'monkeys',
@@ -37,7 +37,7 @@ describe('axe.utils.findBy', function() {
assert.isUndefined(axe.utils.findBy(array, 'id', 'macaque'));
});
- it('should not throw if passed falsey first parameter', function() {
+ it('should not throw if passed falsey first parameter', function () {
assert.isUndefined(axe.utils.findBy(null, 'id', 'macaque'));
});
});
diff --git a/test/core/utils/flattened-tree.js b/test/core/utils/flattened-tree.js
index 6752837197..517d5b8a1b 100644
--- a/test/core/utils/flattened-tree.js
+++ b/test/core/utils/flattened-tree.js
@@ -1,7 +1,7 @@
var fixture = document.getElementById('fixture');
var shadowSupport = axe.testUtils.shadowSupport;
-describe('axe.utils.getFlattenedTree', function() {
+describe('axe.utils.getFlattenedTree', function () {
'use strict';
function createStyle(box) {
var style = document.createElement('style');
@@ -37,7 +37,7 @@ describe('axe.utils.getFlattenedTree', function() {
assert.equal(virtualDOM[1].children.length, 1);
assert.equal(virtualDOM[1].children[0].actualNode.nodeName, 'UL');
assert.equal(virtualDOM[1].children[0].parent, virtualDOM[1]);
- virtualDOM[1].children[0].children.forEach(function(child, index) {
+ virtualDOM[1].children[0].children.forEach(function (child, index) {
assert.equal(child.actualNode.nodeName, 'LI');
assert.isTrue(child.actualNode.textContent === 3 * (index + 1) + '');
});
@@ -74,22 +74,22 @@ describe('axe.utils.getFlattenedTree', function() {
);
}
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should default to document', function() {
+ it('should default to document', function () {
fixture.innerHTML = '';
var tree = axe.utils.getFlattenedTree();
assert(tree[0].actualNode === document.documentElement);
});
- it('should set `null` on the parent for the root node', function() {
+ it('should set `null` on the parent for the root node', function () {
var tree = axe.utils.getFlattenedTree();
assert(tree[0].parent === null);
});
- it('creates virtual nodes in the correct order', function() {
+ it('creates virtual nodes in the correct order', function () {
fixture.innerHTML = '
';
var vNode = axe.utils.getFlattenedTree(fixture)[0];
@@ -107,14 +107,14 @@ describe('axe.utils.getFlattenedTree', function() {
assert.equal(vNode.children[1].children[0].props.nodeName, 's');
});
- it('should add selectorMap to root element', function() {
+ it('should add selectorMap to root element', function () {
var tree = axe.utils.getFlattenedTree();
assert.exists(tree[0]._selectorMap);
});
if (shadowSupport.v0) {
- describe('shadow DOM v0', function() {
- beforeEach(function() {
+ describe('shadow DOM v0', function () {
+ beforeEach(function () {
function createStoryGroup(className, contentSelector) {
var group = document.createElement('div');
group.className = className;
@@ -141,10 +141,10 @@ describe('axe.utils.getFlattenedTree', function() {
fixture.querySelectorAll('.stories').forEach(makeShadowTree);
});
- it('it should support shadow DOM v0', function() {
+ it('it should support shadow DOM v0', function () {
assert.isDefined(fixture.firstChild.shadowRoot);
});
- it('getFlattenedTree should return an array of stuff', function() {
+ it('getFlattenedTree should return an array of stuff', function () {
assert.isTrue(
Array.isArray(axe.utils.getFlattenedTree(fixture.firstChild))
);
@@ -161,8 +161,8 @@ describe('axe.utils.getFlattenedTree', function() {
}
if (shadowSupport.v1) {
- describe('shadow DOM v1', function() {
- beforeEach(function() {
+ describe('shadow DOM v1', function () {
+ beforeEach(function () {
function createStoryGroup(className, slotName) {
var group = document.createElement('div');
group.className = className;
@@ -193,10 +193,10 @@ describe('axe.utils.getFlattenedTree', function() {
fixture.querySelectorAll('.stories').forEach(makeShadowTree);
});
- it('should support shadow DOM v1', function() {
+ it('should support shadow DOM v1', function () {
assert.isDefined(fixture.firstChild.shadowRoot);
});
- it('getFlattenedTree should return an array of stuff', function() {
+ it('getFlattenedTree should return an array of stuff', function () {
assert.isTrue(
Array.isArray(axe.utils.getFlattenedTree(fixture.firstChild))
);
@@ -209,7 +209,7 @@ describe('axe.utils.getFlattenedTree', function() {
"getFlattenedTree's virtual DOM should give an ID to the shadow DOM",
shadowIdAssertions
);
- it("getFlattenedTree's virtual DOM should have the fallback content", function() {
+ it("getFlattenedTree's virtual DOM should have the fallback content", function () {
var virtualDOM = axe.utils.getFlattenedTree(fixture);
assert.isTrue(
virtualDOM[0].children[2].children[1].children[0].children.length ===
@@ -229,11 +229,11 @@ describe('axe.utils.getFlattenedTree', function() {
);
});
});
- describe('shadow DOM v1: boxed slots', function() {
- afterEach(function() {
+ describe('shadow DOM v1: boxed slots', function () {
+ afterEach(function () {
fixture.innerHTML = '';
});
- beforeEach(function() {
+ beforeEach(function () {
function createStoryGroup(className, slotName) {
var group = document.createElement('div');
group.className = className;
@@ -264,17 +264,17 @@ describe('axe.utils.getFlattenedTree', function() {
fixture.querySelectorAll('.stories').forEach(makeShadowTree);
});
- it("getFlattenedTree's virtual DOM should have the elements", function() {
+ it("getFlattenedTree's virtual DOM should have the elements", function () {
return; // Chrome's implementation of slot is broken
// var virtualDOM = axe.utils.getFlattenedTree(fixture);
// assert.isTrue(virtualDOM[0].children[1].children[0].children[0].actualNode.nodeName === 'SLOT');
});
});
- describe('getNodeFromTree', function() {
- afterEach(function() {
+ describe('getNodeFromTree', function () {
+ afterEach(function () {
fixture.innerHTML = '';
});
- beforeEach(function() {
+ beforeEach(function () {
function createStoryGroup(className, slotName) {
var group = document.createElement('div');
group.className = className;
@@ -305,7 +305,7 @@ describe('axe.utils.getFlattenedTree', function() {
fixture.querySelectorAll('.stories').forEach(makeShadowTree);
});
- it('should find the virtual node that matches the real node passed in', function() {
+ it('should find the virtual node that matches the real node passed in', function () {
axe.utils.getFlattenedTree(fixture);
var node = document.querySelector('.stories li');
var vNode = axe.utils.getNodeFromTree(node);
@@ -313,7 +313,7 @@ describe('axe.utils.getFlattenedTree', function() {
assert.equal(node, vNode.actualNode);
assert.equal(vNode.actualNode.textContent, '1');
});
- it('should find the virtual node if it is the very top of the tree', function() {
+ it('should find the virtual node if it is the very top of the tree', function () {
var virtualDOM = axe.utils.getFlattenedTree(fixture);
var vNode = axe.utils.getNodeFromTree(
virtualDOM[0],
@@ -322,7 +322,7 @@ describe('axe.utils.getFlattenedTree', function() {
assert.isDefined(vNode);
assert.equal(virtualDOM[0].actualNode, vNode.actualNode);
});
- it('should not throw if getDistributedNodes is missing', function() {
+ it('should not throw if getDistributedNodes is missing', function () {
var getDistributedNodes = fixture.getDistributedNodes;
fixture.getDistributedNodes = undefined;
try {
@@ -339,16 +339,16 @@ describe('axe.utils.getFlattenedTree', function() {
});
});
} else {
- it('does not throw when slot elements are used', function() {
+ it('does not throw when slot elements are used', function () {
fixture.innerHTML = ' ';
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
axe.utils.getFlattenedTree(fixture);
});
});
}
if (shadowSupport.undefined) {
- describe('shadow dom undefined', function() {
+ describe('shadow dom undefined', function () {
it('SHADOW DOM TESTS DEFERRED, NO SUPPORT');
});
}
diff --git a/test/core/utils/frame-messenger/frame-messenger.js b/test/core/utils/frame-messenger/frame-messenger.js
index 9fca538e71..72ffd3f67e 100644
--- a/test/core/utils/frame-messenger/frame-messenger.js
+++ b/test/core/utils/frame-messenger/frame-messenger.js
@@ -1,4 +1,4 @@
-describe('frame-messenger', function() {
+describe('frame-messenger', function () {
var fixture,
axeVersion,
axeApplication,
@@ -10,7 +10,7 @@ describe('frame-messenger', function() {
var postMessage = window.postMessage;
var captureError = axe.testUtils.captureError;
- beforeEach(function(done) {
+ beforeEach(function (done) {
respondable = axe.utils.respondable;
axeVersion = axe.version;
axeLog = axe.log;
@@ -18,7 +18,7 @@ describe('frame-messenger', function() {
frame = document.createElement('iframe');
frame.src = '../mock/frames/test.html';
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
frameWin = frame.contentWindow;
frameSubscribe = frameWin.axe.utils.respondable.subscribe;
done();
@@ -29,7 +29,7 @@ describe('frame-messenger', function() {
fixture.appendChild(frame);
});
- afterEach(function() {
+ afterEach(function () {
axe.version = axeVersion;
axe._audit.application = axeApplication;
axe.log = axeLog;
@@ -37,18 +37,18 @@ describe('frame-messenger', function() {
window.postMessage = postMessage;
});
- it('can be subscribed to', function(done) {
- frameSubscribe('greeting', function() {
+ it('can be subscribed to', function (done) {
+ frameSubscribe('greeting', function () {
done();
});
respondable(frameWin, 'greeting', 'hello');
});
- it('forwards the message', function(done) {
+ it('forwards the message', function (done) {
var expected = { hello: 'world' };
frameSubscribe(
'greeting',
- captureError(function(actual) {
+ captureError(function (actual) {
assert.deepEqual(actual, expected);
done();
}, done)
@@ -56,10 +56,10 @@ describe('frame-messenger', function() {
respondable(frameWin, 'greeting', expected);
});
- it('passes a truthy keepalive value', function(done) {
+ it('passes a truthy keepalive value', function (done) {
frameSubscribe(
'greeting',
- captureError(function(_, keepalive) {
+ captureError(function (_, keepalive) {
assert.isTrue(keepalive);
done();
}, done)
@@ -67,10 +67,10 @@ describe('frame-messenger', function() {
respondable(frameWin, 'greeting', 'hello', 'truthy');
});
- it('passes a falsy keepalive value', function(done) {
+ it('passes a falsy keepalive value', function (done) {
frameSubscribe(
'greeting',
- captureError(function(_, keepalive) {
+ captureError(function (_, keepalive) {
assert.isFalse(keepalive);
done();
}, done)
@@ -78,16 +78,16 @@ describe('frame-messenger', function() {
respondable(frameWin, 'greeting', 'hello', 0);
});
- it('can not publish to a parent frame', function(done) {
+ it('can not publish to a parent frame', function (done) {
var isCalled = false;
- axe.utils.respondable.subscribe('greeting', function() {
+ axe.utils.respondable.subscribe('greeting', function () {
isCalled = true;
});
- assert.throws(function() {
+ assert.throws(function () {
frameWin.axe.utils.respondable(window, 'greeting', 'hello', 0);
});
setTimeout(
- captureError(function() {
+ captureError(function () {
assert.isFalse(isCalled);
done();
}, done),
@@ -95,7 +95,7 @@ describe('frame-messenger', function() {
);
});
- it('does not expose private methods', function() {
+ it('does not expose private methods', function () {
var methods = Object.keys(respondable).sort();
assert.deepEqual(
methods,
@@ -103,11 +103,11 @@ describe('frame-messenger', function() {
);
});
- it('passes serialized information only', function(done) {
+ it('passes serialized information only', function (done) {
var div = document.createElement('div');
frameSubscribe(
'greeting',
- captureError(function(message) {
+ captureError(function (message) {
assert.deepEqual(message, {});
done();
}, done)
@@ -116,7 +116,7 @@ describe('frame-messenger', function() {
respondable(frameWin, 'greeting', div);
});
- it('posts message to allowed origins', function() {
+ it('posts message to allowed origins', function () {
axe.configure({
allowedOrigins: [window.location.origin, 'http://customOrigin.com']
});
@@ -129,7 +129,7 @@ describe('frame-messenger', function() {
assert.deepEqual(spy.secondCall.args[1], 'http://customOrigin.com');
});
- it('posts message to allowed origins using ', function() {
+ it('posts message to allowed origins using ', function () {
axe.configure({
allowedOrigins: ['']
});
@@ -141,7 +141,7 @@ describe('frame-messenger', function() {
assert.deepEqual(spy.firstCall.args[1], window.location.origin);
});
- it('posts message to allowed origins using ', function() {
+ it('posts message to allowed origins using ', function () {
axe.configure({
allowedOrigins: ['http://customOrigin.com', '']
});
@@ -153,7 +153,7 @@ describe('frame-messenger', function() {
assert.equal(spy.firstCall.args[1], '*');
});
- it('does not post message if no allowed origins', function() {
+ it('does not post message if no allowed origins', function () {
axe.configure({
allowedOrigins: []
});
@@ -163,7 +163,7 @@ describe('frame-messenger', function() {
assert.isFalse(spy.called);
});
- it('does not post message if no allowed origins', function() {
+ it('does not post message if no allowed origins', function () {
axe._audit.allowedOrigins = null;
var spy = sinon.spy(frameWin, 'postMessage');
var posted = respondable(frameWin, 'greeting');
@@ -171,7 +171,7 @@ describe('frame-messenger', function() {
assert.isFalse(spy.called);
});
- it('does not post message if allowed origins is empty', function() {
+ it('does not post message if allowed origins is empty', function () {
axe.configure({
allowedOrigins: []
});
@@ -181,27 +181,27 @@ describe('frame-messenger', function() {
assert.isFalse(spy.called);
});
- it('throws error if origin is invalid', function() {
+ it('throws error if origin is invalid', function () {
axe.configure({
allowedOrigins: ['foo.com']
});
- assert.throws(function() {
+ assert.throws(function () {
respondable(frameWin, 'greeting');
}, 'allowedOrigins value "foo.com" is not a valid origin');
});
- it('does not log error if message is null', function(done) {
+ it('does not log error if message is null', function (done) {
axe.configure({
allowedOrigins: ['']
});
var called = false;
- frameWin.axe.log = function() {
+ frameWin.axe.log = function () {
called = true;
};
frameWin.postMessage(null, '*');
- setTimeout(function() {
+ setTimeout(function () {
try {
assert.isFalse(called);
done();
@@ -211,14 +211,14 @@ describe('frame-messenger', function() {
}, 500);
});
- describe('isInFrame', function() {
- it('is false for the page window', function() {
+ describe('isInFrame', function () {
+ it('is false for the page window', function () {
var frameRespondable = frameWin.axe.utils.respondable;
assert.isFalse(respondable.isInFrame());
assert.isFalse(frameRespondable.isInFrame(window));
});
- it('is true for iframes', function() {
+ it('is true for iframes', function () {
var frameRespondable = frameWin.axe.utils.respondable;
assert.isTrue(frameRespondable.isInFrame());
assert.isTrue(respondable.isInFrame(frameWin));
diff --git a/test/core/utils/get-all-checks.js b/test/core/utils/get-all-checks.js
index dbcf57c053..64e09fa593 100644
--- a/test/core/utils/get-all-checks.js
+++ b/test/core/utils/get-all-checks.js
@@ -1,11 +1,11 @@
-describe('axe.utils.getAllChecks', function() {
+describe('axe.utils.getAllChecks', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.getAllChecks);
});
- it('should concatenate all 3 check collections', function() {
+ it('should concatenate all 3 check collections', function () {
var r = {
any: ['any:foo', 'any:bar'],
all: ['all:foo', 'all:bar'],
@@ -21,7 +21,7 @@ describe('axe.utils.getAllChecks', function() {
]);
});
- it('should safely ignore missing collections - all', function() {
+ it('should safely ignore missing collections - all', function () {
var r = {
any: ['any:foo', 'any:bar'],
none: ['none:foo', 'none:bar']
@@ -34,7 +34,7 @@ describe('axe.utils.getAllChecks', function() {
]);
});
- it('should safely ignore missing collections - any', function() {
+ it('should safely ignore missing collections - any', function () {
var r = {
all: ['all:foo', 'all:bar'],
none: ['none:foo', 'none:bar']
@@ -47,7 +47,7 @@ describe('axe.utils.getAllChecks', function() {
]);
});
- it('should safely ignore missing collections - none', function() {
+ it('should safely ignore missing collections - none', function () {
var r = {
any: ['any:foo', 'any:bar'],
all: ['all:foo', 'all:bar']
diff --git a/test/core/utils/get-ancestry.js b/test/core/utils/get-ancestry.js
index 37f1bd2135..c074f6f138 100644
--- a/test/core/utils/get-ancestry.js
+++ b/test/core/utils/get-ancestry.js
@@ -1,17 +1,17 @@
-describe('axe.utils.getAncestry', function() {
+describe('axe.utils.getAncestry', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowTest = axe.testUtils.shadowSupport.v1 ? it : xit;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.getAncestry);
});
- it('should generate an ancestry selector', function() {
+ it('should generate an ancestry selector', function () {
fixture.innerHTML = '1
2
3
';
var sel1 = axe.utils.getAncestry(fixture.children[0]);
@@ -27,7 +27,7 @@ describe('axe.utils.getAncestry', function() {
assert.isNotNull(document.querySelector(sel1));
});
- shadowTest('generates selectors of nested shadow trees', function() {
+ shadowTest('generates selectors of nested shadow trees', function () {
var node = document.createElement('section');
fixture.appendChild(node);
diff --git a/test/core/utils/get-base-lang.js b/test/core/utils/get-base-lang.js
index 8c9374aaa4..80f9dfe41a 100644
--- a/test/core/utils/get-base-lang.js
+++ b/test/core/utils/get-base-lang.js
@@ -1,27 +1,27 @@
-describe('axe.utils.getBaseLang', function() {
+describe('axe.utils.getBaseLang', function () {
'use strict';
- it('returns base lang as peanut for argument peanut-BUTTER', function() {
+ it('returns base lang as peanut for argument peanut-BUTTER', function () {
var actual = axe.utils.getBaseLang('peanut-BUTTER');
assert.equal(actual, 'peanut');
});
- it('returns base lang as fr for argument FR-CA', function() {
+ it('returns base lang as fr for argument FR-CA', function () {
var actual = axe.utils.getBaseLang('FR-CA');
assert.strictEqual(actual, 'fr');
});
- it('returns base lang which is the prefix string before the first - (hyphen)', function() {
+ it('returns base lang which is the prefix string before the first - (hyphen)', function () {
var actual = axe.utils.getBaseLang('en-GB');
assert.equal(actual, 'en');
});
- it('returns primary language subtag as base lang for multi hyphenated argument', function() {
+ it('returns primary language subtag as base lang for multi hyphenated argument', function () {
var actual = axe.utils.getBaseLang('SOME-random-lang');
assert.strictEqual(actual, 'some');
});
- it('returns an empty string when argument is null or undefined', function() {
+ it('returns an empty string when argument is null or undefined', function () {
var actualNull = axe.utils.getBaseLang(null);
var actualUndefined = axe.utils.getBaseLang(undefined);
var actualEmpty = axe.utils.getBaseLang();
diff --git a/test/core/utils/get-check-message.js b/test/core/utils/get-check-message.js
index 40b4fac78e..a449fba7cd 100644
--- a/test/core/utils/get-check-message.js
+++ b/test/core/utils/get-check-message.js
@@ -1,7 +1,7 @@
-describe('axe.utils.getCheckMessage', function() {
+describe('axe.utils.getCheckMessage', function () {
var getCheckMessage = axe.utils.getCheckMessage;
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = {
data: {
checks: {
@@ -17,26 +17,26 @@ describe('axe.utils.getCheckMessage', function() {
};
});
- afterEach(function() {
+ afterEach(function () {
axe._audit = undefined;
});
- it('should return the pass message', function() {
+ it('should return the pass message', function () {
assert.equal(getCheckMessage('my-check', 'pass'), 'Pass message');
});
- it('should return the fail message', function() {
+ it('should return the fail message', function () {
assert.equal(getCheckMessage('my-check', 'fail'), 'Fail message');
});
- it('should return the incomplete message', function() {
+ it('should return the incomplete message', function () {
assert.equal(
getCheckMessage('my-check', 'incomplete'),
'Incomplete message'
);
});
- it('should handle data', function() {
+ it('should handle data', function () {
axe._audit.data.checks['my-check'].messages.pass =
'Pass message with ${data.message}';
assert.equal(
@@ -45,14 +45,14 @@ describe('axe.utils.getCheckMessage', function() {
);
});
- it('should error when check does not exist', function() {
- assert.throws(function() {
+ it('should error when check does not exist', function () {
+ assert.throws(function () {
getCheckMessage('invalid-check', 'pass');
});
});
- it('should error when check message does not exist', function() {
- assert.throws(function() {
+ it('should error when check message does not exist', function () {
+ assert.throws(function () {
getCheckMessage('invalid-check', 'invalid');
});
});
diff --git a/test/core/utils/get-check-option.js b/test/core/utils/get-check-option.js
index 73c9591df5..01a26f19e7 100644
--- a/test/core/utils/get-check-option.js
+++ b/test/core/utils/get-check-option.js
@@ -1,7 +1,7 @@
-describe('axe.utils.getCheckOption', function() {
+describe('axe.utils.getCheckOption', function () {
'use strict';
- it('should prefer options from rules', function() {
+ it('should prefer options from rules', function () {
assert.deepEqual(
axe.utils.getCheckOption(
{
@@ -36,7 +36,7 @@ describe('axe.utils.getCheckOption', function() {
}
);
});
- it('should fallback to global check options if not defined on the rule', function() {
+ it('should fallback to global check options if not defined on the rule', function () {
assert.deepEqual(
axe.utils.getCheckOption(
{
@@ -71,7 +71,7 @@ describe('axe.utils.getCheckOption', function() {
);
});
- it('should prefer fallback to global check options if not defined on the rule', function() {
+ it('should prefer fallback to global check options if not defined on the rule', function () {
assert.deepEqual(
axe.utils.getCheckOption(
{
@@ -97,7 +97,7 @@ describe('axe.utils.getCheckOption', function() {
);
});
- it('should otherwise use the check', function() {
+ it('should otherwise use the check', function () {
assert.deepEqual(
axe.utils.getCheckOption(
{
@@ -116,7 +116,7 @@ describe('axe.utils.getCheckOption', function() {
);
});
- it('passes absolutePaths option along', function() {
+ it('passes absolutePaths option along', function () {
assert.deepEqual(
axe.utils.getCheckOption(
{
diff --git a/test/core/utils/get-environment-data.js b/test/core/utils/get-environment-data.js
index bb4a9a877a..6669e9b377 100644
--- a/test/core/utils/get-environment-data.js
+++ b/test/core/utils/get-environment-data.js
@@ -1,13 +1,13 @@
-describe('utils.getEnvironmentData', function() {
+describe('utils.getEnvironmentData', function () {
'use strict';
var __audit;
var getEnvironmentData = axe.utils.getEnvironmentData;
- before(function() {
+ before(function () {
__audit = axe._audit;
axe._audit = { brand: 'Deque' };
});
- after(function() {
+ after(function () {
axe._audit = __audit;
});
@@ -17,25 +17,25 @@ describe('utils.getEnvironmentData', function() {
name: 'axe-core',
version: axe.version
}
- }
- var output = getEnvironmentData(input)
+ };
+ var output = getEnvironmentData(input);
assert.equal(input, output);
- })
+ });
- it('should return a `testEngine` property', function() {
+ it('should return a `testEngine` property', function () {
var data = getEnvironmentData();
assert.isObject(data.testEngine);
assert.equal(data.testEngine.name, 'axe-core');
assert.equal(data.testEngine.version, axe.version);
});
- it('should return a `testRunner` property', function() {
+ it('should return a `testRunner` property', function () {
var data = getEnvironmentData();
assert.isObject(data.testRunner);
assert.equal(data.testRunner.name, axe._audit.brand);
});
- it('should return a `testEnvironment` property', function() {
+ it('should return a `testEnvironment` property', function () {
var data = getEnvironmentData();
assert.isObject(data.testEnvironment);
assert.ok(data.testEnvironment.userAgent);
@@ -45,12 +45,12 @@ describe('utils.getEnvironmentData', function() {
assert.isNotNull(data.testEnvironment.orientationType);
});
- it('should return a `timestamp` property`', function() {
+ it('should return a `timestamp` property`', function () {
var data = getEnvironmentData();
assert.isDefined(data.timestamp);
});
- it('should return a `url` property', function() {
+ it('should return a `url` property', function () {
var data = getEnvironmentData();
assert.isDefined(data.url);
});
@@ -58,7 +58,7 @@ describe('utils.getEnvironmentData', function() {
// TODO: remove or update test once we are testing axe-core in jsdom and
// other supported environments as what this is testing should be done in
// those environment tests
- it('gets data from the `win` parameter when passed', function() {
+ it('gets data from the `win` parameter when passed', function () {
var data = getEnvironmentData(null, {
screen: {
orientation: {
diff --git a/test/core/utils/get-frame-contexts.js b/test/core/utils/get-frame-contexts.js
index 4e58c37ee0..30f72d29e9 100644
--- a/test/core/utils/get-frame-contexts.js
+++ b/test/core/utils/get-frame-contexts.js
@@ -1,19 +1,19 @@
-describe('utils.getFrameContexts', function() {
+describe('utils.getFrameContexts', function () {
var getFrameContexts = axe.utils.getFrameContexts;
var shadowSupported = axe.testUtils.shadowSupport.v1;
var fixture = document.querySelector('#fixture');
- it('returns an empty array if the page has no frames', function() {
+ it('returns an empty array if the page has no frames', function () {
var frameContext = getFrameContexts();
assert.isArray(frameContext);
assert.lengthOf(frameContext, 0);
});
- it('returns a `frameSelector` for each included frame', function() {
+ it('returns a `frameSelector` for each included frame', function () {
fixture.innerHTML =
'' + '' + '';
- var selectors = getFrameContexts().map(function(frameData) {
+ var selectors = getFrameContexts().map(function (frameData) {
return frameData.frameSelector;
});
assert.lengthOf(selectors, 3);
@@ -22,11 +22,11 @@ describe('utils.getFrameContexts', function() {
assert.include(selectors[2], 'iframe:nth-child(3)');
});
- it('sets frameContext.initiator to false for each included frame', function() {
+ it('sets frameContext.initiator to false for each included frame', function () {
fixture.innerHTML =
'' + '' + '';
- var contexts = getFrameContexts().map(function(frameData) {
+ var contexts = getFrameContexts().map(function (frameData) {
return frameData.frameContext;
});
@@ -36,13 +36,13 @@ describe('utils.getFrameContexts', function() {
assert.isFalse(contexts[2].initiator);
});
- it('sets frameContext.focusable depending on the frame', function() {
+ it('sets frameContext.focusable depending on the frame', function () {
fixture.innerHTML =
'' +
'' +
'';
- var contexts = getFrameContexts().map(function(frameData) {
+ var contexts = getFrameContexts().map(function (frameData) {
return frameData.frameContext;
});
assert.lengthOf(contexts, 3);
@@ -51,13 +51,13 @@ describe('utils.getFrameContexts', function() {
assert.isFalse(contexts[2].focusable);
});
- it('sets frameContext.size based on frame size', function() {
+ it('sets frameContext.size based on frame size', function () {
fixture.innerHTML =
'' +
'' +
'';
- var frameSize = getFrameContexts().map(function(frameData) {
+ var frameSize = getFrameContexts().map(function (frameData) {
return frameData.frameContext.size;
});
assert.lengthOf(frameSize, 3);
@@ -75,8 +75,8 @@ describe('utils.getFrameContexts', function() {
});
});
- describe('include / exclude', function() {
- it('returns a `frameContext` for each included frame', function() {
+ describe('include / exclude', function () {
+ it('returns a `frameContext` for each included frame', function () {
fixture.innerHTML =
'' +
'' +
@@ -88,7 +88,7 @@ describe('utils.getFrameContexts', function() {
],
exclude: [['#f3', 'footer']]
};
- var contexts = getFrameContexts(context).map(function(frameData) {
+ var contexts = getFrameContexts(context).map(function (frameData) {
return frameData.frameContext;
});
@@ -101,12 +101,12 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(contexts[2].exclude, [['footer']]);
});
- it('excludes non-frame contexts', function() {
+ it('excludes non-frame contexts', function () {
fixture.innerHTML = '';
var context = {
include: [['#header'], ['a'], ['#f1', 'header']]
};
- var contexts = getFrameContexts(context).map(function(frameData) {
+ var contexts = getFrameContexts(context).map(function (frameData) {
return frameData.frameContext;
});
@@ -115,7 +115,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(contexts[0].exclude, []);
});
- it('mixes contexts if the frame is selected twice', function() {
+ it('mixes contexts if the frame is selected twice', function () {
fixture.innerHTML =
'' + '';
var context = {
@@ -125,7 +125,7 @@ describe('utils.getFrameContexts', function() {
],
exclude: [['iframe', 'main']]
};
- var contexts = getFrameContexts(context).map(function(frameData) {
+ var contexts = getFrameContexts(context).map(function (frameData) {
return frameData.frameContext;
});
assert.lengthOf(contexts, 2);
@@ -135,7 +135,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(contexts[1].exclude, [['main']]);
});
- it('combines include/exclude arrays of frames selected twice', function() {
+ it('combines include/exclude arrays of frames selected twice', function () {
fixture.innerHTML = '';
var context = {
include: [
@@ -147,7 +147,7 @@ describe('utils.getFrameContexts', function() {
['iframe', 'footer']
]
};
- var contexts = getFrameContexts(context).map(function(frameData) {
+ var contexts = getFrameContexts(context).map(function (frameData) {
return frameData.frameContext;
});
@@ -156,7 +156,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(contexts[0].exclude, [['aside'], ['footer']]);
});
- it('skips excluded frames', function() {
+ it('skips excluded frames', function () {
fixture.innerHTML =
'' +
'' +
@@ -164,7 +164,7 @@ describe('utils.getFrameContexts', function() {
var context = {
exclude: [[['#f2']]]
};
- var selectors = getFrameContexts(context).map(function(frameData) {
+ var selectors = getFrameContexts(context).map(function (frameData) {
return frameData.frameSelector;
});
assert.lengthOf(selectors, 2);
@@ -172,7 +172,7 @@ describe('utils.getFrameContexts', function() {
assert.include(selectors[1], 'iframe:nth-child(3)');
});
- it('skips frames excluded by a parent', function() {
+ it('skips frames excluded by a parent', function () {
fixture.innerHTML = '';
var frameContexts = getFrameContexts({
exclude: [['#fixture']]
@@ -180,7 +180,7 @@ describe('utils.getFrameContexts', function() {
assert.lengthOf(frameContexts, 0);
});
- it('normalizes the context', function() {
+ it('normalizes the context', function () {
var frameContexts;
fixture.innerHTML =
'' + '';
@@ -203,7 +203,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(frameContexts[0].frameContext.exclude, []);
});
- it('accepts elements', function() {
+ it('accepts elements', function () {
var frameContexts;
fixture.innerHTML =
'' + '';
@@ -228,7 +228,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(frameContexts[0].frameContext.exclude, []);
});
- it('works with nested frames', function() {
+ it('works with nested frames', function () {
fixture.innerHTML =
'' + '';
var context = {
@@ -238,7 +238,7 @@ describe('utils.getFrameContexts', function() {
],
exclude: [['#f2', '#f6', '#f7', '#f7', 'main']]
};
- var contexts = getFrameContexts(context).map(function(frameData) {
+ var contexts = getFrameContexts(context).map(function (frameData) {
return frameData.frameContext;
});
@@ -249,7 +249,7 @@ describe('utils.getFrameContexts', function() {
assert.deepEqual(contexts[1].exclude, [['#f6', '#f7', '#f7', 'main']]);
});
- (shadowSupported ? it : xit)('works on iframes in shadow dom', function() {
+ (shadowSupported ? it : xit)('works on iframes in shadow dom', function () {
fixture.innerHTML = '
';
var div = fixture.querySelector('div');
var shadowRoot = div.attachShadow({ mode: 'open' });
@@ -266,14 +266,14 @@ describe('utils.getFrameContexts', function() {
});
});
- describe('options.iframes', function() {
- it('returns a non-empty array with `iframes: true`', function() {
+ describe('options.iframes', function () {
+ it('returns a non-empty array with `iframes: true`', function () {
fixture.innerHTML = '';
var contexts = getFrameContexts({}, { iframes: true });
assert.lengthOf(contexts, 1);
});
- it('returns an empty array with `iframes: false`', function() {
+ it('returns an empty array with `iframes: false`', function () {
fixture.innerHTML = '';
var contexts = getFrameContexts({}, { iframes: false });
assert.lengthOf(contexts, 0);
diff --git a/test/core/utils/get-friendly-uri-end.js b/test/core/utils/get-friendly-uri-end.js
index 50944c6eb2..4377aafc62 100644
--- a/test/core/utils/get-friendly-uri-end.js
+++ b/test/core/utils/get-friendly-uri-end.js
@@ -1,27 +1,27 @@
-describe('axe.utils.getFriendlyUriEnd', function() {
+describe('axe.utils.getFriendlyUriEnd', function () {
'use strict';
var getFriendlyUriEnd = axe.utils.getFriendlyUriEnd;
- it('returns a domain name', function() {
+ it('returns a domain name', function () {
assert.equal('deque.com', getFriendlyUriEnd('http://deque.com'));
assert.equal('deque.com/', getFriendlyUriEnd('https://www.deque.com/'));
assert.equal('docs.deque.com/', getFriendlyUriEnd('//docs.deque.com/'));
});
- it('returns a filename', function() {
+ it('returns a filename', function () {
assert.equal('contact/', getFriendlyUriEnd('../../contact/'));
assert.equal('contact/', getFriendlyUriEnd('http://deque.com/contact/'));
assert.equal('contact', getFriendlyUriEnd('/contact'));
assert.equal('contact.html', getFriendlyUriEnd('/contact.html'));
});
- it('trims whitespace', function() {
+ it('trims whitespace', function () {
assert.equal(undefined, getFriendlyUriEnd(' '));
assert.equal('start page', getFriendlyUriEnd('start page\t'));
assert.equal('home#heading', getFriendlyUriEnd('home#heading '));
});
- it('returns a hash URI', function() {
+ it('returns a hash URI', function () {
assert.equal('#footer', getFriendlyUriEnd('#footer'));
assert.equal(
'contact.html#footer',
@@ -30,22 +30,22 @@ describe('axe.utils.getFriendlyUriEnd', function() {
assert.equal('home.html#main', getFriendlyUriEnd('/home.html#main '));
});
- it('returns undef when there is a query', function() {
+ it('returns undef when there is a query', function () {
assert.isUndefined(getFriendlyUriEnd('/contact?'));
assert.isUndefined(getFriendlyUriEnd('/contact?foo=bar'));
});
- it('returns undef for index files', function() {
+ it('returns undef for index files', function () {
assert.isUndefined(getFriendlyUriEnd('/index.cfs'));
assert.isUndefined(getFriendlyUriEnd('/index'));
});
- it('returns undef when the result is too short', function() {
+ it('returns undef when the result is too short', function () {
assert.isUndefined(getFriendlyUriEnd('/i.html'));
assert.isUndefined(getFriendlyUriEnd('/dq'));
});
- it('returns undef when the result is too long', function() {
+ it('returns undef when the result is too long', function () {
assert.isDefined(getFriendlyUriEnd('/abcd.html', { maxLength: 50 }));
assert.isDefined(getFriendlyUriEnd('#foo-bar-baz', { maxLength: 50 }));
assert.isDefined(getFriendlyUriEnd('//deque.com', { maxLength: 50 }));
@@ -55,7 +55,7 @@ describe('axe.utils.getFriendlyUriEnd', function() {
assert.isUndefined(getFriendlyUriEnd('//deque.com', { maxLength: 5 }));
});
- it('returns undef when the result has too many numbers', function() {
+ it('returns undef when the result has too many numbers', function () {
assert.isUndefined(getFriendlyUriEnd('123456.html'));
});
});
diff --git a/test/core/utils/get-node-attributes.js b/test/core/utils/get-node-attributes.js
index 856c1493dd..45d57b8269 100644
--- a/test/core/utils/get-node-attributes.js
+++ b/test/core/utils/get-node-attributes.js
@@ -1,7 +1,7 @@
-describe('axe.utils.getNodeAttributes', function() {
+describe('axe.utils.getNodeAttributes', function () {
'use strict';
- it('should return the list of attributes', function() {
+ it('should return the list of attributes', function () {
var node = document.createElement('div');
node.setAttribute('class', 'foo bar');
var actual = axe.utils.getNodeAttributes(node);
@@ -10,7 +10,7 @@ describe('axe.utils.getNodeAttributes', function() {
assert.equal(actual[0].name, 'class');
});
- it('should return the list of attributes when the DOM is clobbered', function() {
+ it('should return the list of attributes when the DOM is clobbered', function () {
var node = document.createElement('form');
node.setAttribute('id', '123');
node.innerHTML = ' ';
diff --git a/test/core/utils/get-root-node.js b/test/core/utils/get-root-node.js
index a18facc9d2..9b2805d47d 100644
--- a/test/core/utils/get-root-node.js
+++ b/test/core/utils/get-root-node.js
@@ -6,28 +6,28 @@ function makeShadowTreeGRN(node) {
root.appendChild(div);
}
-describe('axe.utils.getRootNode', function() {
+describe('axe.utils.getRootNode', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowSupported = axe.testUtils.shadowSupport.v1;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should return the document when the node is just a normal node', function() {
+ it('should return the document when the node is just a normal node', function () {
fixture.innerHTML = '
';
var node = document.getElementById('target');
assert.isTrue(axe.utils.getRootNode(node) === document);
});
- it('should return the document when the node is disconnected', function() {
+ it('should return the document when the node is disconnected', function () {
var node = document.createElement('div');
assert.isTrue(axe.utils.getRootNode(node) === document);
});
(shadowSupported ? it : xit)(
'should return the shadow root when it is inside the shadow DOM',
- function() {
+ function () {
var shadEl;
// shadow DOM v1 - note: v0 is compatible with this code, so no need
// to specifically test this
diff --git a/test/core/utils/get-rule.js b/test/core/utils/get-rule.js
index d4cf073bcd..15603609de 100644
--- a/test/core/utils/get-rule.js
+++ b/test/core/utils/get-rule.js
@@ -1,5 +1,5 @@
-describe('axe.utils.getRule', function() {
- beforeEach(function() {
+describe('axe.utils.getRule', function () {
+ beforeEach(function () {
axe._load({
rules: [
{
@@ -12,13 +12,13 @@ describe('axe.utils.getRule', function() {
});
});
- it('should return the rule by the id', function() {
+ it('should return the rule by the id', function () {
var rule = axe.utils.getRule('rule1');
assert.isTrue(rule.id === 'rule1');
});
- it("should throw error if the rule doesn't exist", function() {
- assert.throws(function() {
+ it("should throw error if the rule doesn't exist", function () {
+ assert.throws(function () {
axe.utils.getRule('no-id');
});
});
diff --git a/test/core/utils/get-scroll.js b/test/core/utils/get-scroll.js
index 33ceffeb13..adef7d32db 100644
--- a/test/core/utils/get-scroll.js
+++ b/test/core/utils/get-scroll.js
@@ -1,19 +1,19 @@
-describe('axe.utils.getScroll', function() {
+describe('axe.utils.getScroll', function () {
'use strict';
var fixture = document.getElementById('fixture');
var queryFixture = axe.testUtils.queryFixture;
var shadowSupported = axe.testUtils.shadowSupport.v1;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('is a function', function() {
+ it('is a function', function () {
assert.isFunction(axe.utils.getScroll);
});
- it('returns undefined when element is not scrollable', function() {
+ it('returns undefined when element is not scrollable', function () {
var target = queryFixture(
'This element is not scrollable '
);
@@ -21,7 +21,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns undefined when element does not overflow', function() {
+ it('returns undefined when element does not overflow', function () {
var target = queryFixture(
'' +
'
' +
@@ -33,7 +33,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns undefined when element overflow is hidden', function() {
+ it('returns undefined when element overflow is hidden', function () {
var target = queryFixture(
'
' +
'
' +
@@ -45,7 +45,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns undefined when element overflow is clip', function() {
+ it('returns undefined when element overflow is clip', function () {
var target = queryFixture(
'
' +
'
' +
@@ -57,7 +57,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns scroll offset when element overflow is auto', function() {
+ it('returns scroll offset when element overflow is auto', function () {
var target = queryFixture(
'
' +
'
' +
@@ -72,7 +72,7 @@ describe('axe.utils.getScroll', function() {
assert.equal(actual.left, 0);
});
- it('returns undefined when element overflow is visible', function() {
+ it('returns undefined when element overflow is visible', function () {
var target = queryFixture(
'
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.
'
);
@@ -80,7 +80,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns scroll offset when element overflow is scroll', function() {
+ it('returns scroll offset when element overflow is scroll', function () {
var target = queryFixture(
'
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.
'
);
@@ -91,14 +91,14 @@ describe('axe.utils.getScroll', function() {
assert.equal(actual.left, 0);
});
- describe('shadowDOM - axe.utils.getScroll', function() {
- before(function() {
+ describe('shadowDOM - axe.utils.getScroll', function () {
+ before(function () {
if (!shadowSupported) {
this.skip();
}
});
- it('returns undefined when shadowDOM element does not overflow', function() {
+ it('returns undefined when shadowDOM element does not overflow', function () {
fixture.innerHTML = '
';
var root = fixture.firstChild.attachShadow({ mode: 'open' });
@@ -112,7 +112,7 @@ describe('axe.utils.getScroll', function() {
assert.isUndefined(actual);
});
- it('returns scroll offset when shadowDOM element has overflow', function() {
+ it('returns scroll offset when shadowDOM element has overflow', function () {
fixture.innerHTML = '
';
var root = fixture.firstChild.attachShadow({ mode: 'open' });
diff --git a/test/core/utils/get-selector.js b/test/core/utils/get-selector.js
index c6cd4381cd..520bfbea56 100644
--- a/test/core/utils/get-selector.js
+++ b/test/core/utils/get-selector.js
@@ -38,32 +38,32 @@ function makeNonuniqueLongAttributes(fixture) {
return node;
}
-describe('axe.utils.getSelector', function() {
+describe('axe.utils.getSelector', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowSupported = axe.testUtils.shadowSupport.v1;
var fixtureSetup = axe.testUtils.fixtureSetup;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe._tree = undefined;
axe._selectorData = undefined;
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.getSelector);
});
- it('throws if axe._selectorData is undefined', function() {
- assert.throws(function() {
+ it('throws if axe._selectorData is undefined', function () {
+ assert.throws(function () {
var node = document.createElement('div');
fixture.appendChild(node);
axe.utils.getSelector(node);
});
});
- it('should generate a unique CSS selector', function() {
+ it('should generate a unique CSS selector', function () {
var node = document.createElement('div');
fixtureSetup(node);
var sel = axe.utils.getSelector(node);
@@ -73,7 +73,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should still work if an element has nothing but whitespace as a className', function() {
+ it('should still work if an element has nothing but whitespace as a className', function () {
var node = document.createElement('div');
node.className = ' ';
fixtureSetup(node);
@@ -84,7 +84,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should handle special characters in IDs', function() {
+ it('should handle special characters in IDs', function () {
var node = document.createElement('div');
node.id = 'monkeys#are.animals\\ok';
fixtureSetup(node);
@@ -94,7 +94,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should handle special characters in classNames', function() {
+ it('should handle special characters in classNames', function () {
var node = document.createElement('div');
node.className = '. bb-required';
fixtureSetup(node);
@@ -104,7 +104,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should be able to fall back to positional selectors', function() {
+ it('should be able to fall back to positional selectors', function () {
var node, expected;
var nodes = [];
for (var i = 0; i < 10; i++) {
@@ -120,7 +120,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], expected);
});
- it('should use a unique ID', function() {
+ it('should use a unique ID', function () {
var node = document.createElement('div');
node.id = 'monkeys';
fixtureSetup(node);
@@ -134,7 +134,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should not use ids if they are not unique', function() {
+ it('should not use ids if they are not unique', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
node1.id = 'monkeys';
@@ -149,7 +149,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use classes if available and unique', function() {
+ it('should use classes if available and unique', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
node1.className = 'monkeys simian';
@@ -165,7 +165,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use classes if more unique than the tag', function() {
+ it('should use classes if more unique than the tag', function () {
var node1 = document.createElement('p');
var node2 = document.createElement('p');
node1.className = 'monkeys simian cats';
@@ -180,7 +180,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should NOT use classes if they are more common than the tag', function() {
+ it('should NOT use classes if they are more common than the tag', function () {
var node1 = document.createElement('p');
var node2 = document.createElement('p');
node1.className = 'dogs cats';
@@ -197,7 +197,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use the most unique class', function() {
+ it('should use the most unique class', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
node1.className = 'dogs';
@@ -212,7 +212,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use the most unique class and not the unique attribute', function() {
+ it('should use the most unique class and not the unique attribute', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
@@ -230,7 +230,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use only a single unique attribute', function() {
+ it('should use only a single unique attribute', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
@@ -248,7 +248,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use three uncommon but not unique features', function() {
+ it('should use three uncommon but not unique features', function () {
var node1 = document.createElement('div');
node1.setAttribute('data-axe', 'hello');
node1.setAttribute('data-thing', 'hello');
@@ -278,7 +278,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use only three uncommon but not unique features', function() {
+ it('should use only three uncommon but not unique features', function () {
var node1 = document.createElement('div');
node1.setAttribute('data-axe', 'hello');
node1.setAttribute('data-thing', 'hello');
@@ -295,11 +295,11 @@ describe('axe.utils.getSelector', function() {
var sel = axe.utils.getSelector(node2);
var parts = sel.split('.');
parts = parts
- .reduce(function(val, item) {
+ .reduce(function (val, item) {
var its = item.split('[');
return val.concat(its);
}, [])
- .filter(function(item) {
+ .filter(function (item) {
return item !== '';
});
assert.equal(parts.length, 3);
@@ -309,7 +309,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use only three uncommon but not unique classes', function() {
+ it('should use only three uncommon but not unique classes', function () {
var node1 = document.createElement('div');
var node2 = document.createElement('div');
node1.className = 'thing thang thug thick';
@@ -319,11 +319,11 @@ describe('axe.utils.getSelector', function() {
var sel = axe.utils.getSelector(node2);
var parts = sel.split('.');
parts = parts
- .reduce(function(val, item) {
+ .reduce(function (val, item) {
var its = item.split('[');
return val.concat(its);
}, [])
- .filter(function(item) {
+ .filter(function (item) {
return item !== '';
});
assert.equal(parts.length, 3);
@@ -333,7 +333,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should use only three uncommon but not unique attributes', function() {
+ it('should use only three uncommon but not unique attributes', function () {
var node1 = document.createElement('div');
node1.setAttribute('data-axe', 'hello');
node1.setAttribute('data-thug', 'hello');
@@ -350,11 +350,11 @@ describe('axe.utils.getSelector', function() {
var sel = axe.utils.getSelector(node2);
var parts = sel.split('.');
parts = parts
- .reduce(function(val, item) {
+ .reduce(function (val, item) {
var its = item.split('[');
return val.concat(its);
}, [])
- .filter(function(item) {
+ .filter(function (item) {
return item !== '';
});
assert.equal(parts.length, 4);
@@ -364,14 +364,14 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should not use long attributes', function() {
+ it('should not use long attributes', function () {
var node = makeNonuniqueLongAttributes(fixture);
fixtureSetup();
var sel = axe.utils.getSelector(node, {});
assert.isTrue(sel.indexOf('data-att') === -1);
});
- it('should use :root when not unique html element', function() {
+ it('should use :root when not unique html element', function () {
var node = document.createElement('html');
node.setAttribute('lang', 'en');
fixtureSetup(node);
@@ -380,7 +380,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(sel, ':root');
});
- it('should use position if classes are not unique', function() {
+ it('should use position if classes are not unique', function () {
var node1 = document.createElement('div');
node1.className = 'monkeys simian';
@@ -397,7 +397,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node2);
});
- it('should work on the documentElement', function() {
+ it('should work on the documentElement', function () {
fixtureSetup();
var sel = axe.utils.getSelector(document.documentElement);
@@ -406,7 +406,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], document.documentElement);
});
- it('should work on the documentElement with classes', function() {
+ it('should work on the documentElement with classes', function () {
var orig = document.documentElement.className;
document.documentElement.className = 'stuff and other things';
fixtureSetup();
@@ -418,7 +418,7 @@ describe('axe.utils.getSelector', function() {
document.documentElement.className = orig;
});
- it('should work on the body', function() {
+ it('should work on the body', function () {
fixtureSetup();
var sel = axe.utils.getSelector(document.body);
var result = document.querySelectorAll(sel);
@@ -427,7 +427,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], document.body);
});
- it('should work on namespaced elements', function() {
+ it('should work on namespaced elements', function () {
fixtureSetup('
Hello ');
var node = fixture.firstChild;
@@ -437,7 +437,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should work on complex namespaced elements', function() {
+ it('should work on complex namespaced elements', function () {
fixtureSetup(
'
' +
'x ' +
@@ -454,7 +454,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(result[0], node);
});
- it('should not use ignored attributes', function() {
+ it('should not use ignored attributes', function () {
var node = document.createElement('div');
var ignoredAttributes = [
'style',
@@ -473,7 +473,7 @@ describe('axe.utils.getSelector', function() {
'aria-pressed',
'aria-valuenow'
];
- ignoredAttributes.forEach(function(att) {
+ ignoredAttributes.forEach(function (att) {
node.setAttribute(att, 'true');
});
fixtureSetup(node);
@@ -481,7 +481,7 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(axe.utils.getSelector(node).indexOf('[') === -1);
});
- it('should use href and src attributes, shortened', function() {
+ it('should use href and src attributes, shortened', function () {
var link1 = document.createElement('a');
link1.setAttribute('href', '//deque.com/thang/');
@@ -498,7 +498,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(axe.utils.getSelector(img2), 'img[src$="logo.png"]');
});
- it('should escape href attributes', function() {
+ it('should escape href attributes', function () {
var link1 = document.createElement('a');
link1.setAttribute('href', '//deque.com/about/');
@@ -512,7 +512,7 @@ describe('axe.utils.getSelector', function() {
);
});
- it('should not URL encode or token escape href attribute', function() {
+ it('should not URL encode or token escape href attribute', function () {
var link1 = document.createElement('a');
link1.setAttribute('href', '3 Seater');
@@ -525,7 +525,7 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(axe.utils.matchesSelector(link2, expected));
});
- it('should escape certain special characters in attribute', function() {
+ it('should escape certain special characters in attribute', function () {
var div1 = document.createElement('div');
div1.setAttribute('data-thing', 'foobar');
@@ -538,7 +538,7 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(axe.utils.matchesSelector(div2, expected));
});
- it('should escape newline characters in attribute', function() {
+ it('should escape newline characters in attribute', function () {
var div1 = document.createElement('div');
div1.setAttribute('data-thing', 'foobar');
@@ -551,7 +551,7 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(axe.utils.matchesSelector(div2, expected));
});
- it('should not generate universal selectors', function() {
+ it('should not generate universal selectors', function () {
var node = document.createElement('div');
node.setAttribute('role', 'menuitem');
fixtureSetup(node);
@@ -559,7 +559,7 @@ describe('axe.utils.getSelector', function() {
assert.equal(axe.utils.getSelector(node), 'div[role="menuitem"]');
});
- it('should work correctly when a URL attribute cannot be shortened', function() {
+ it('should work correctly when a URL attribute cannot be shortened', function () {
var href1 = 'mars2.html?a=be_bold';
var node1 = document.createElement('a');
node1.setAttribute('href', href1);
@@ -577,7 +577,7 @@ describe('axe.utils.getSelector', function() {
// to specifically test this
(shadowSupported ? it : xit)(
'no options: should work with shadow DOM',
- function() {
+ function () {
var shadEl;
fixture.innerHTML = '
';
makeShadowTreeGetSelector(fixture.firstChild);
@@ -595,7 +595,7 @@ describe('axe.utils.getSelector', function() {
// to specifically test this
(shadowSupported ? it : xit)(
'toRoot: should work with shadow DOM',
- function() {
+ function () {
var shadEl;
fixture.innerHTML = '
';
makeShadowTreeGetSelector(fixture.firstChild);
@@ -610,7 +610,7 @@ describe('axe.utils.getSelector', function() {
}
);
- it('should correctly calculate unique selector when no discernable features', function() {
+ it('should correctly calculate unique selector when no discernable features', function () {
var node = makeNonunique(fixture);
fixtureSetup();
@@ -619,7 +619,7 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(mine === node);
});
- it('should not traverse further up than required when no discernable features', function() {
+ it('should not traverse further up than required when no discernable features', function () {
var node = makeNonunique(fixture);
fixtureSetup();
@@ -630,12 +630,12 @@ describe('axe.utils.getSelector', function() {
assert.isTrue(test === top);
});
- it('should not error if fragment is no longer in the DOM', function() {
+ it('should not error if fragment is no longer in the DOM', function () {
var fragment = document.createDocumentFragment();
var node = document.createElement('div');
fragment.appendChild(node);
fixtureSetup();
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
axe.utils.getSelector(node);
});
});
diff --git a/test/core/utils/get-shadow-selector.js b/test/core/utils/get-shadow-selector.js
index 057c0fcf22..bfdd361df3 100644
--- a/test/core/utils/get-shadow-selector.js
+++ b/test/core/utils/get-shadow-selector.js
@@ -1,4 +1,4 @@
-describe('axe.utils.getShadowSelector', function() {
+describe('axe.utils.getShadowSelector', function () {
var fixture = document.getElementById('fixture');
var shadowTest = axe.testUtils.shadowSupport.v1 ? it : xit;
var getShadowSelector = axe.utils.getShadowSelector;
@@ -7,11 +7,11 @@ describe('axe.utils.getShadowSelector', function() {
return node.nodeName.toLowerCase();
}
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('returns generated output for light DOM nodes', function() {
+ it('returns generated output for light DOM nodes', function () {
var h1 = document.createElement('h1');
fixture.appendChild(h1);
@@ -19,7 +19,7 @@ describe('axe.utils.getShadowSelector', function() {
assert.equal(selector, 'h1');
});
- it('passes node and options to generator', function() {
+ it('passes node and options to generator', function () {
var called = false;
var node = document.createElement('h1');
var options = { hello: 'world' };
@@ -33,7 +33,7 @@ describe('axe.utils.getShadowSelector', function() {
assert.isTrue(called);
});
- it('passes am empty object if no options are provided', function() {
+ it('passes am empty object if no options are provided', function () {
var called = false;
var node = document.createElement('h1');
function generator(_, arg2) {
@@ -45,7 +45,7 @@ describe('axe.utils.getShadowSelector', function() {
assert.isTrue(called);
});
- shadowTest('returns the output of the generator for light DOM', function() {
+ shadowTest('returns the output of the generator for light DOM', function () {
fixture.innerHTML = '
Hello world ';
var div = fixture.querySelector('div');
var h1 = fixture.querySelector('h1');
@@ -57,7 +57,7 @@ describe('axe.utils.getShadowSelector', function() {
shadowTest(
'returns an array of outputs for each shadow tree host',
- function() {
+ function () {
var node = document.createElement('section');
fixture.appendChild(node);
diff --git a/test/core/utils/get-stylesheet-factory.js b/test/core/utils/get-stylesheet-factory.js
index 012e49814b..69ae9ee14d 100644
--- a/test/core/utils/get-stylesheet-factory.js
+++ b/test/core/utils/get-stylesheet-factory.js
@@ -1,22 +1,22 @@
-describe('axe.utils.getStyleSheetFactory', function() {
+describe('axe.utils.getStyleSheetFactory', function () {
'use strict';
var dynamicDoc = document.implementation.createHTMLDocument(
'Dynamic document for testing axe.utils.getStyleSheetFactory'
);
- it('throws if there is no argument of dynamicDocument', function() {
- assert.throws(function() {
+ it('throws if there is no argument of dynamicDocument', function () {
+ assert.throws(function () {
axe.utils.getStyleSheetFactory();
});
});
- it('returns a function when passed argument of dynamicDocument', function() {
+ it('returns a function when passed argument of dynamicDocument', function () {
var actual = axe.utils.getStyleSheetFactory(dynamicDoc);
assert.isFunction(actual);
});
- it('returns a CSSOM stylesheet, when invoked with data (text)', function() {
+ it('returns a CSSOM stylesheet, when invoked with data (text)', function () {
var stylesheetFactory = axe.utils.getStyleSheetFactory(dynamicDoc);
var actual = stylesheetFactory({
data: '.someStyle{background-color:red;}',
diff --git a/test/core/utils/get-xpath.js b/test/core/utils/get-xpath.js
index e962ba7ac3..78f4ec174d 100644
--- a/test/core/utils/get-xpath.js
+++ b/test/core/utils/get-xpath.js
@@ -1,17 +1,17 @@
-describe('axe.utils.getXpath', function() {
+describe('axe.utils.getXpath', function () {
'use strict';
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.getXpath);
});
- it('should generate an XPath selector', function() {
+ it('should generate an XPath selector', function () {
var node = document.createElement('div');
fixture.appendChild(node);
@@ -20,7 +20,7 @@ describe('axe.utils.getXpath', function() {
assert.equal(sel, "/div[@id='fixture']/div");
});
- it('should handle special characters', function() {
+ it('should handle special characters', function () {
var node = document.createElement('div');
node.id = 'monkeys#are.animals\\ok';
fixture.appendChild(node);
@@ -30,7 +30,7 @@ describe('axe.utils.getXpath', function() {
);
});
- it('should stop on unique ID', function() {
+ it('should stop on unique ID', function () {
var node = document.createElement('div');
node.id = 'monkeys';
fixture.appendChild(node);
@@ -39,7 +39,7 @@ describe('axe.utils.getXpath', function() {
assert.equal(sel, "/div[@id='monkeys']");
});
- it('should not use ids if they are not unique', function() {
+ it('should not use ids if they are not unique', function () {
var node = document.createElement('div');
node.id = 'monkeys';
fixture.appendChild(node);
@@ -53,7 +53,7 @@ describe('axe.utils.getXpath', function() {
assert.equal(sel, "/div[@id='fixture']/div[2]");
});
- it('should properly calculate number when siblings are of different type', function() {
+ it('should properly calculate number when siblings are of different type', function () {
var node, target;
node = document.createElement('span');
fixture.appendChild(node);
@@ -79,17 +79,17 @@ describe('axe.utils.getXpath', function() {
assert.equal(sel, "/div[@id='fixture']/div[2]");
});
- it('should work on the documentElement', function() {
+ it('should work on the documentElement', function () {
var sel = axe.utils.getXpath(document.documentElement);
assert.equal(sel, '/html');
});
- it('should work on the body', function() {
+ it('should work on the body', function () {
var sel = axe.utils.getXpath(document.body);
assert.equal(sel, '/html/body');
});
- it('should work on namespaced elements', function() {
+ it('should work on namespaced elements', function () {
fixture.innerHTML = 'Hello ';
var node = fixture.firstChild;
var sel = axe.utils.getXpath(node);
diff --git a/test/core/utils/is-hidden.js b/test/core/utils/is-hidden.js
index 4e4826783b..8be07f0da2 100644
--- a/test/core/utils/is-hidden.js
+++ b/test/core/utils/is-hidden.js
@@ -15,32 +15,32 @@ function makeShadowTreeHidden(node) {
div.appendChild(createContentHidden());
}
-describe('axe.utils.isHidden', function() {
+describe('axe.utils.isHidden', function () {
'use strict';
var fixture = document.getElementById('fixture');
var shadowSupported = axe.testUtils.shadowSupport.v1;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.isHidden);
});
- it('should return false on detached elements', function() {
+ it('should return false on detached elements', function () {
var el = document.createElement('div');
el.innerHTML = 'I am not visible because I am detached!';
assert.isTrue(axe.utils.isHidden(el));
});
- it('should return false on a document', function() {
+ it('should return false on a document', function () {
assert.isFalse(axe.utils.isHidden(document));
});
- it('should return true if `aria-hidden` is set', function() {
+ it('should return true if `aria-hidden` is set', function () {
fixture.innerHTML =
'Hidden from screen readers
';
@@ -48,7 +48,7 @@ describe('axe.utils.isHidden', function() {
assert.isTrue(axe.utils.isHidden(el));
});
- it('should return true if `display: none` is set', function() {
+ it('should return true if `display: none` is set', function () {
fixture.innerHTML =
'Hidden from screen readers
';
@@ -56,7 +56,7 @@ describe('axe.utils.isHidden', function() {
assert.isTrue(axe.utils.isHidden(el));
});
- it('should return true if `aria-hidden` is set on parent', function() {
+ it('should return true if `aria-hidden` is set on parent', function () {
fixture.innerHTML =
'Hidden from screen readers
';
@@ -64,7 +64,7 @@ describe('axe.utils.isHidden', function() {
assert.isTrue(axe.utils.isHidden(el));
});
- it('should know how `visibility` works', function() {
+ it('should know how `visibility` works', function () {
fixture.innerHTML =
'' +
'
Hi
' +
@@ -76,7 +76,7 @@ describe('axe.utils.isHidden', function() {
(shadowSupported ? it : xit)(
'not hidden: should work when the element is inside shadow DOM',
- function() {
+ function () {
var tree, node;
// shadow DOM v1 - note: v0 is compatible with this code, so no need
// to specifically test this
@@ -90,7 +90,7 @@ describe('axe.utils.isHidden', function() {
(shadowSupported ? it : xit)(
'hidden: should work when the element is inside shadow DOM',
- function() {
+ function () {
var tree, node;
// shadow DOM v1 - note: v0 is compatible with this code, so no need
// to specifically test this
@@ -104,7 +104,7 @@ describe('axe.utils.isHidden', function() {
(shadowSupported ? it : xit)(
'should work with hidden slotted elements',
- function() {
+ function () {
function createContentSlotted() {
var group = document.createElement('div');
group.innerHTML =
diff --git a/test/core/utils/is-html-element.js b/test/core/utils/is-html-element.js
index 1d9c504384..caa9c7518a 100644
--- a/test/core/utils/is-html-element.js
+++ b/test/core/utils/is-html-element.js
@@ -1,34 +1,34 @@
/* global axe */
-describe('axe.utils.isHtmlElement', function() {
+describe('axe.utils.isHtmlElement', function () {
var queryFixture = axe.testUtils.queryFixture;
var isHtmlElement = axe.utils.isHtmlElement;
- it('returns true if given ul', function() {
+ it('returns true if given ul', function () {
var node = document.createElement('ul');
assert.isTrue(isHtmlElement(node));
});
- it('returns true if given nav', function() {
+ it('returns true if given nav', function () {
var node = document.createElement('nav');
assert.isTrue(isHtmlElement(node));
});
- it('returns true if given iframe', function() {
+ it('returns true if given iframe', function () {
var node = document.createElement('iframe');
assert.isTrue(isHtmlElement(node));
});
- it('returns false if given custom element', function() {
+ it('returns false if given custom element', function () {
var node = document.createElement('myElement');
assert.isFalse(isHtmlElement(node));
});
- it('returns false if given svg namespace', function() {
+ it('returns false if given svg namespace', function () {
var node = document.createElementNS('http://www.w3.org/2000/svg', 'a');
assert.isFalse(isHtmlElement(node));
});
- it('returns false if node has inherited svg namespace', function() {
+ it('returns false if node has inherited svg namespace', function () {
var svgNameSpace = 'http://www.w3.org/2000/svg';
var node = document.createElementNS(svgNameSpace, 'svg');
var child = document.createElementNS(svgNameSpace, 'a');
@@ -40,12 +40,12 @@ describe('axe.utils.isHtmlElement', function() {
assert.isFalse(isHtmlElement(childNode));
});
- it('works with VirtualNodes', function() {
+ it('works with VirtualNodes', function () {
var vNode = queryFixture('
');
assert.isTrue(isHtmlElement(vNode));
});
- it('works with SerialVirtualNode', function() {
+ it('works with SerialVirtualNode', function () {
var vNode = new axe.SerialVirtualNode({ nodeName: 'ul' });
assert.isTrue(isHtmlElement(vNode));
});
diff --git a/test/core/utils/is-shadow-root.js b/test/core/utils/is-shadow-root.js
index dba796917d..fbfc858e75 100644
--- a/test/core/utils/is-shadow-root.js
+++ b/test/core/utils/is-shadow-root.js
@@ -1,7 +1,7 @@
var fixture = document.getElementById('fixture');
var shadowSupport = axe.testUtils.shadowSupport;
-describe('axe.utils.isShadowRoot', function() {
+describe('axe.utils.isShadowRoot', function () {
'use strict';
function createStyle(box) {
@@ -15,35 +15,35 @@ describe('axe.utils.isShadowRoot', function() {
var isShadowRoot = axe.utils.isShadowRoot;
- it('returns false if the node has no shadowRoot', function() {
+ it('returns false if the node has no shadowRoot', function () {
assert.isFalse(isShadowRoot({ nodeName: 'DIV', shadowRoot: undefined }));
});
- it('returns true if the native element allows shadow DOM', function() {
+ it('returns true if the native element allows shadow DOM', function () {
assert.isTrue(isShadowRoot({ nodeName: 'DIV', shadowRoot: {} }));
assert.isTrue(isShadowRoot({ nodeName: 'H1', shadowRoot: {} }));
assert.isTrue(isShadowRoot({ nodeName: 'ASIDE', shadowRoot: {} }));
});
- it('returns true if a custom element with shadowRoot', function() {
+ it('returns true if a custom element with shadowRoot', function () {
assert.isTrue(isShadowRoot({ nodeName: 'X-BUTTON', shadowRoot: {} }));
assert.isTrue(
isShadowRoot({ nodeName: 'T1000-SCHWARZENEGGER', shadowRoot: {} })
);
});
- it('returns true if an invalid custom element with shadowRoot', function() {
+ it('returns true if an invalid custom element with shadowRoot', function () {
assert.isFalse(isShadowRoot({ nodeName: '0-BUZZ', shadowRoot: {} }));
assert.isFalse(isShadowRoot({ nodeName: '--ELM--', shadowRoot: {} }));
});
- it('returns false if the native element does not allow shadow DOM', function() {
+ it('returns false if the native element does not allow shadow DOM', function () {
assert.isFalse(isShadowRoot({ nodeName: 'IFRAME', shadowRoot: {} }));
assert.isFalse(isShadowRoot({ nodeName: 'STRONG', shadowRoot: {} }));
});
if (shadowSupport.v1) {
- describe('shadow DOM v1', function() {
- afterEach(function() {
+ describe('shadow DOM v1', function () {
+ afterEach(function () {
fixture.innerHTML = '';
});
- beforeEach(function() {
+ beforeEach(function () {
function createStoryGroup(className, slotName) {
var group = document.createElement('div');
group.className = className;
@@ -74,7 +74,7 @@ describe('axe.utils.isShadowRoot', function() {
fixture.querySelectorAll('.stories').forEach(makeShadowTree);
});
- it('should support shadow DOM v1', function() {
+ it('should support shadow DOM v1', function () {
assert.isDefined(fixture.firstChild.shadowRoot);
});
});
diff --git a/test/core/utils/is-xhtml.js b/test/core/utils/is-xhtml.js
index da4a0eaaf6..97ca125a8f 100644
--- a/test/core/utils/is-xhtml.js
+++ b/test/core/utils/is-xhtml.js
@@ -1,11 +1,11 @@
-describe('axe.utils.isXHTML', function() {
+describe('axe.utils.isXHTML', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.isXHTML);
});
- it('should return true on any document that is XHTML', function() {
+ it('should return true on any document that is XHTML', function () {
var doc = document.implementation.createDocument(
'http://www.w3.org/1999/xhtml',
'html',
@@ -14,12 +14,12 @@ describe('axe.utils.isXHTML', function() {
assert.isTrue(axe.utils.isXHTML(doc));
});
- it('should return false on any document that is HTML', function() {
+ it('should return false on any document that is HTML', function () {
var doc = document.implementation.createHTMLDocument('Monkeys');
assert.isFalse(axe.utils.isXHTML(doc));
});
- it('should return false on any document that is HTML - fixture', function() {
+ it('should return false on any document that is HTML - fixture', function () {
assert.isFalse(axe.utils.isXHTML(document));
});
});
diff --git a/test/core/utils/matchAncestry.js b/test/core/utils/matchAncestry.js
index 5f2b0552e3..6cca99ee0d 100644
--- a/test/core/utils/matchAncestry.js
+++ b/test/core/utils/matchAncestry.js
@@ -1,16 +1,16 @@
-describe('axe.utils.matchAncestry', function() {
+describe('axe.utils.matchAncestry', function () {
'use strict';
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.matchAncestry);
});
- it('should match when ancestry is the same and one level', function() {
+ it('should match when ancestry is the same and one level', function () {
var result = axe.utils.matchAncestry(
['html > body > div:nth-child(1)'],
['html > body > div:nth-child(1)']
@@ -18,7 +18,7 @@ describe('axe.utils.matchAncestry', function() {
assert.isTrue(result);
});
- it('should not match when ancestry is different and one level', function() {
+ it('should not match when ancestry is different and one level', function () {
var result = axe.utils.matchAncestry(
['html > body > div:nth-child(3)'],
['html > body > div:nth-child(1)']
@@ -26,7 +26,7 @@ describe('axe.utils.matchAncestry', function() {
assert.isFalse(result);
});
- it('should not match when ancestries have different numbers of elements', function() {
+ it('should not match when ancestries have different numbers of elements', function () {
var result = axe.utils.matchAncestry(
['iframe', 'html > body > div:nth-child(1)'],
['html > body > div:nth-child(1)']
@@ -34,7 +34,7 @@ describe('axe.utils.matchAncestry', function() {
assert.isFalse(result);
});
- it('should not match when first level is different and second level is the same', function() {
+ it('should not match when first level is different and second level is the same', function () {
var result = axe.utils.matchAncestry(
['iframe', 'html > body > div:nth-child(1)'],
['otherIframe', 'html > body > div:nth-child(1)']
@@ -42,7 +42,7 @@ describe('axe.utils.matchAncestry', function() {
assert.isFalse(result);
});
- it('should not match when second level is different and first level is the same', function() {
+ it('should not match when second level is different and first level is the same', function () {
var result = axe.utils.matchAncestry(
['iframe', 'html > body > div:nth-child(1)'],
['iframe', 'html > body > div:nth-child(2)']
@@ -50,7 +50,7 @@ describe('axe.utils.matchAncestry', function() {
assert.isFalse(result);
});
- it('should match when all levels are the same', function() {
+ it('should match when all levels are the same', function () {
var result = axe.utils.matchAncestry(
['iframe', 'iframe2', 'html > body > div:nth-child(1)'],
['iframe', 'iframe2', 'html > body > div:nth-child(1)']
diff --git a/test/core/utils/memoize.js b/test/core/utils/memoize.js
index 57b28ba36e..7c85033614 100644
--- a/test/core/utils/memoize.js
+++ b/test/core/utils/memoize.js
@@ -1,7 +1,7 @@
-describe('axe.utils.memoize', function() {
+describe('axe.utils.memoize', function () {
'use strict';
- it('should add the function to axe._memoizedFns', function() {
+ it('should add the function to axe._memoizedFns', function () {
axe._memoizedFns.length = 0;
axe.utils.memoize(function myFn() {});
diff --git a/test/core/utils/merge-results.js b/test/core/utils/merge-results.js
index 6c821c3330..85c15760fc 100644
--- a/test/core/utils/merge-results.js
+++ b/test/core/utils/merge-results.js
@@ -1,8 +1,8 @@
-describe('axe.utils.mergeResults', function() {
+describe('axe.utils.mergeResults', function () {
'use strict';
var queryFixture = axe.testUtils.queryFixture;
- it('should normalize empty results', function() {
+ it('should normalize empty results', function () {
var result = axe.utils.mergeResults([
{ results: [] },
{ results: [{ id: 'a', result: 'b' }] }
@@ -15,7 +15,7 @@ describe('axe.utils.mergeResults', function() {
]);
});
- it('merges frame content, including all selector types', function() {
+ it('merges frame content, including all selector types', function () {
var iframe = queryFixture('
').actualNode;
var node = {
selector: ['#foo'],
@@ -49,7 +49,7 @@ describe('axe.utils.mergeResults', function() {
assert.deepEqual(node.nodeIndexes, [1, 123]);
});
- it('merges frame specs', function() {
+ it('merges frame specs', function () {
var iframe = queryFixture('
').actualNode;
var frameSpec = new axe.utils.DqElement(iframe).toJSON();
var node = {
@@ -84,7 +84,7 @@ describe('axe.utils.mergeResults', function() {
assert.deepEqual(node.nodeIndexes, [1, 123]);
});
- it('sorts results from iframes into their correct DOM position', function() {
+ it('sorts results from iframes into their correct DOM position', function () {
var result = axe.utils.mergeResults([
{
results: [
@@ -142,13 +142,13 @@ describe('axe.utils.mergeResults', function() {
}
]);
- var ids = result[0].nodes.map(function(el) {
+ var ids = result[0].nodes.map(function (el) {
return el.node.selector.join(' >> ');
});
assert.deepEqual(ids, ['h1', 'iframe1 >> h2', 'iframe1 >> h3', 'h4']);
});
- it('sorts nested iframes', function() {
+ it('sorts nested iframes', function () {
var result = axe.utils.mergeResults([
{
results: [
@@ -207,7 +207,7 @@ describe('axe.utils.mergeResults', function() {
}
]);
- var ids = result[0].nodes.map(function(el) {
+ var ids = result[0].nodes.map(function (el) {
return el.node.selector.join(' >> ');
});
assert.deepEqual(ids, [
@@ -219,7 +219,7 @@ describe('axe.utils.mergeResults', function() {
]);
});
- it('sorts results even if nodeIndexes are empty', function() {
+ it('sorts results even if nodeIndexes are empty', function () {
var result = axe.utils.mergeResults([
{
results: [
@@ -282,7 +282,7 @@ describe('axe.utils.mergeResults', function() {
}
]);
- var ids = result[0].nodes.map(function(el) {
+ var ids = result[0].nodes.map(function (el) {
return el.node.selector.join(' >> ');
});
// Order of "nill" varies in IE
@@ -296,7 +296,7 @@ describe('axe.utils.mergeResults', function() {
]);
});
- it('sorts results even if nodeIndexes are undefined', function() {
+ it('sorts results even if nodeIndexes are undefined', function () {
var result = axe.utils.mergeResults([
{
results: [
@@ -356,7 +356,7 @@ describe('axe.utils.mergeResults', function() {
}
]);
- var ids = result[0].nodes.map(function(el) {
+ var ids = result[0].nodes.map(function (el) {
return el.node.selector.join(' >> ');
});
// Order of "nill" varies in IE
@@ -370,7 +370,7 @@ describe('axe.utils.mergeResults', function() {
]);
});
- it('sorts nodes all placed on the same result', function() {
+ it('sorts nodes all placed on the same result', function () {
var result = axe.utils.mergeResults([
{
results: [
@@ -408,7 +408,7 @@ describe('axe.utils.mergeResults', function() {
}
]);
- var ids = result[0].nodes.map(function(el) {
+ var ids = result[0].nodes.map(function (el) {
return el.node.selector.join(' >> ');
});
diff --git a/test/core/utils/node-sorter.js b/test/core/utils/node-sorter.js
index b6ac5dd3aa..74ed8350f9 100644
--- a/test/core/utils/node-sorter.js
+++ b/test/core/utils/node-sorter.js
@@ -1,4 +1,4 @@
-describe('axe.utils.nodeSorter', function() {
+describe('axe.utils.nodeSorter', function () {
'use strict';
function $id(id) {
@@ -7,11 +7,11 @@ describe('axe.utils.nodeSorter', function() {
var fixture = document.getElementById('fixture');
- it('should exist', function() {
+ it('should exist', function () {
assert.isFunction(axe.utils.nodeSorter);
});
- it('should return -1 if a comes before b', function() {
+ it('should return -1 if a comes before b', function () {
fixture.innerHTML = '
';
assert.equal(
@@ -20,7 +20,7 @@ describe('axe.utils.nodeSorter', function() {
);
});
- it('should return -1 if a comes before b - nested', function() {
+ it('should return -1 if a comes before b - nested', function () {
fixture.innerHTML = '
';
assert.equal(
@@ -29,7 +29,7 @@ describe('axe.utils.nodeSorter', function() {
);
});
- it('should return 1 if b comes before a', function() {
+ it('should return 1 if b comes before a', function () {
fixture.innerHTML = '
';
assert.equal(
@@ -38,7 +38,7 @@ describe('axe.utils.nodeSorter', function() {
);
});
- it('should return 1 if b comes before a - nested', function() {
+ it('should return 1 if b comes before a - nested', function () {
fixture.innerHTML = '
';
assert.equal(
@@ -47,7 +47,7 @@ describe('axe.utils.nodeSorter', function() {
);
});
- it('should return 0 if a === b', function() {
+ it('should return 0 if a === b', function () {
fixture.innerHTML = '
';
assert.equal(
diff --git a/test/core/utils/parse-crossorigin-stylesheet.js b/test/core/utils/parse-crossorigin-stylesheet.js
index c7effb02f9..70de40fd16 100644
--- a/test/core/utils/parse-crossorigin-stylesheet.js
+++ b/test/core/utils/parse-crossorigin-stylesheet.js
@@ -1,22 +1,22 @@
-describe('axe.utils.parseCrossOriginStylesheet', function() {
+describe('axe.utils.parseCrossOriginStylesheet', function () {
'use strict';
var dynamicDoc;
var convertDataToStylesheet;
- beforeEach(function() {
+ beforeEach(function () {
dynamicDoc = document.implementation.createHTMLDocument(
'Dynamic document for testing axe.utils.parseCrossOriginStylesheet'
);
convertDataToStylesheet = axe.utils.getStyleSheetFactory(dynamicDoc);
});
- afterEach(function() {
+ afterEach(function () {
dynamicDoc = undefined;
convertDataToStylesheet = undefined;
});
- it('returns cross-origin stylesheet', function(done) {
+ it('returns cross-origin stylesheet', function (done) {
var importUrl =
'https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css';
var options = {
@@ -37,7 +37,7 @@ describe('axe.utils.parseCrossOriginStylesheet', function() {
importedUrls,
isCrossOriginRequest
)
- .then(function(data) {
+ .then(function (data) {
assert.isDefined(data);
assert.isDefined(data.sheet);
@@ -54,12 +54,12 @@ describe('axe.utils.parseCrossOriginStylesheet', function() {
);
done();
})
- .catch(function(err) {
+ .catch(function (err) {
done(err);
});
});
- it('rejects when given url to fetch is not found', function(done) {
+ it('rejects when given url to fetch is not found', function (done) {
this.timeout(axe.constants.preload.timeout + 1000);
var importUrl =
@@ -81,12 +81,12 @@ describe('axe.utils.parseCrossOriginStylesheet', function() {
importedUrls,
isCrossOriginRequest
)
- .then(function() {
+ .then(function () {
done(
new Error('Expected axe.utils.parseCrossOriginStylesheet to reject.')
);
})
- .catch(function(err) {
+ .catch(function (err) {
assert.isNotNull(err);
done();
});
diff --git a/test/core/utils/parse-sameorigin-stylesheet.js b/test/core/utils/parse-sameorigin-stylesheet.js
index 7ab304f984..9f5c2dca6a 100644
--- a/test/core/utils/parse-sameorigin-stylesheet.js
+++ b/test/core/utils/parse-sameorigin-stylesheet.js
@@ -1,4 +1,4 @@
-describe('axe.utils.parseSameOriginStylesheet', function() {
+describe('axe.utils.parseSameOriginStylesheet', function () {
'use strict';
var stylesForPage;
@@ -19,29 +19,29 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
var dynamicDoc;
var convertDataToStylesheet;
- beforeEach(function() {
+ beforeEach(function () {
dynamicDoc = document.implementation.createHTMLDocument(
'Dynamic document for testing axe.utils.parseSameOriginStylesheet'
);
convertDataToStylesheet = axe.utils.getStyleSheetFactory(dynamicDoc);
});
- afterEach(function(done) {
+ afterEach(function (done) {
dynamicDoc = undefined;
convertDataToStylesheet = undefined;
- axe.testUtils.removeStyleSheets(stylesForPage).then(function() {
+ axe.testUtils.removeStyleSheets(stylesForPage).then(function () {
done();
stylesForPage = undefined;
});
});
- it('returns empty results when given sheet has no cssRules', function(done) {
+ it('returns empty results when given sheet has no cssRules', function (done) {
// add style that has no styles
stylesForPage = [styleSheets.emptyStyleTag];
- axe.testUtils.addStyleSheets(stylesForPage).then(function() {
+ axe.testUtils.addStyleSheets(stylesForPage).then(function () {
// get recently added sheet
- var sheet = Array.from(document.styleSheets).filter(function(sheet) {
+ var sheet = Array.from(document.styleSheets).filter(function (sheet) {
return sheet.ownerNode.id === styleSheets.emptyStyleTag.id;
})[0];
// parse sheet
@@ -61,7 +61,7 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
importedUrls,
false
)
- .then(function(data) {
+ .then(function (data) {
assert.isDefined(data);
assert.isDefined(data.sheet);
assert.equal(data.isCrossOrigin, isCrossOriginRequest);
@@ -73,13 +73,13 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
});
});
- it('returns @import rule specified in the stylesheet', function(done) {
+ it('returns @import rule specified in the stylesheet', function (done) {
// add style that has @import style
stylesForPage = [styleSheets.styleTagWithOneImport];
- axe.testUtils.addStyleSheets(stylesForPage).then(function() {
+ axe.testUtils.addStyleSheets(stylesForPage).then(function () {
// get recently added sheet
- var sheet = Array.from(document.styleSheets).filter(function(sheet) {
+ var sheet = Array.from(document.styleSheets).filter(function (sheet) {
return sheet.ownerNode.id === styleSheets.styleTagWithOneImport.id;
})[0];
// parse sheet
@@ -99,7 +99,7 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
importedUrls,
false
)
- .then(function(data) {
+ .then(function (data) {
assert.isDefined(data);
var parsedImportData = data[0];
@@ -119,13 +119,13 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
});
});
- it('returns inline style specified in the stylesheet', function(done) {
+ it('returns inline style specified in the stylesheet', function (done) {
// add style that has @import style
stylesForPage = [styleSheets.inlineStyle];
- axe.testUtils.addStyleSheets(stylesForPage).then(function() {
+ axe.testUtils.addStyleSheets(stylesForPage).then(function () {
// get recently added sheet
- var sheet = Array.from(document.styleSheets).filter(function(sheet) {
+ var sheet = Array.from(document.styleSheets).filter(function (sheet) {
return sheet.ownerNode.id === styleSheets.inlineStyle.id;
})[0];
// parse sheet
@@ -145,7 +145,7 @@ describe('axe.utils.parseSameOriginStylesheet', function() {
importedUrls,
false
)
- .then(function(data) {
+ .then(function (data) {
assert.isDefined(data);
assert.isDefined(data.sheet);
assert.equal(data.isCrossOrigin, isCrossOriginRequest);
diff --git a/test/core/utils/pollyfills.elements-from-point.js b/test/core/utils/pollyfills.elements-from-point.js
index dfaec99a65..3318f18bda 100644
--- a/test/core/utils/pollyfills.elements-from-point.js
+++ b/test/core/utils/pollyfills.elements-from-point.js
@@ -1,19 +1,19 @@
-describe('document.elementsFromPoint pollyfills', function() {
+describe('document.elementsFromPoint pollyfills', function () {
'use strict';
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
document.getElementById('fixture').innerHTML = '';
});
- it('ensures document.elementsFromPoint is always there', function() {
+ it('ensures document.elementsFromPoint is always there', function () {
assert.isFunction(document.elementsFromPoint);
});
- it('returns document.elementsFromPoint if it is set', function() {
+ it('returns document.elementsFromPoint if it is set', function () {
var orig = document.elementsFromPoint;
- document.elementsFromPoint = function() {
+ document.elementsFromPoint = function () {
return 123;
};
@@ -22,12 +22,12 @@ describe('document.elementsFromPoint pollyfills', function() {
document.elementsFromPoint = orig;
});
- it('returns document.msElementsFromPoint if elementsFromPoint is undefined', function() {
+ it('returns document.msElementsFromPoint if elementsFromPoint is undefined', function () {
var orig = document.elementsFromPoint;
var msOrig = document.msElementsFromPoint;
document.elementsFromPoint = undefined;
- document.msElementsFromPoint = function() {
+ document.msElementsFromPoint = function () {
return 123;
};
@@ -38,7 +38,7 @@ describe('document.elementsFromPoint pollyfills', function() {
document.msElementsFromPoint = msOrig;
});
- it('returns the pollyfill no native function is available', function() {
+ it('returns the pollyfill no native function is available', function () {
var orig = document.elementsFromPoint;
var msOrig = document.msElementsFromPoint;
@@ -52,9 +52,9 @@ describe('document.elementsFromPoint pollyfills', function() {
document.msElementsFromPoint = msOrig;
});
- describe('pollyfill function', function() {
+ describe('pollyfill function', function () {
var orig, msOrig;
- before(function() {
+ before(function () {
orig = document.elementsFromPoint;
msOrig = document.msElementsFromPoint;
@@ -64,12 +64,12 @@ describe('document.elementsFromPoint pollyfills', function() {
document.elementsFromPoint = axe.utils.pollyfillElementsFromPoint();
});
- after(function() {
+ after(function () {
document.elementsFromPoint = orig;
document.msElementsFromPoint = msOrig;
});
- it('should return positioned elements properly', function() {
+ it('should return positioned elements properly', function () {
fixture.innerHTML =
'
' +
@@ -94,7 +94,7 @@ describe('document.elementsFromPoint pollyfills', function() {
assert.deepEqual(visualParents.slice(0, 3), [target, pos, container]);
});
- it('should return inline elements properly', function() {
+ it('should return inline elements properly', function () {
fixture.innerHTML =
'
' +
@@ -119,7 +119,7 @@ describe('document.elementsFromPoint pollyfills', function() {
assert.deepEqual(visualParents.slice(0, 3), [target, pos, container]);
});
- it('should return normal flow elements properly', function() {
+ it('should return normal flow elements properly', function () {
fixture.innerHTML =
'
' +
'
' +
@@ -137,7 +137,7 @@ describe('document.elementsFromPoint pollyfills', function() {
assert.deepEqual(visualParents.slice(0, 3), [target, parent, fixture]);
});
- it('returns elements with negative z-index after the body', function() {
+ it('returns elements with negative z-index after the body', function () {
fixture.innerHTML =
'
Target!
' +
'
Some text
';
diff --git a/test/core/utils/preload-cssom.js b/test/core/utils/preload-cssom.js
index ce5815c41e..1b48cae826 100644
--- a/test/core/utils/preload-cssom.js
+++ b/test/core/utils/preload-cssom.js
@@ -4,7 +4,7 @@
* so tests for disabled and external stylesheets are done in `integration` tests
* Refer Directory: `./test/full/preload-cssom/**.*`
*/
-describe('axe.utils.preloadCssom', function() {
+describe('axe.utils.preloadCssom', function () {
'use strict';
var treeRoot;
@@ -26,33 +26,33 @@ describe('axe.utils.preloadCssom', function() {
}
}
- beforeEach(function() {
+ beforeEach(function () {
addStyleToHead();
treeRoot = axe._tree = axe.utils.getFlattenedTree(document);
});
- afterEach(function() {
+ afterEach(function () {
removeStyleFromHead();
});
- it('returns CSSOM object containing an array of sheets', function(done) {
+ it('returns CSSOM object containing an array of sheets', function (done) {
var actual = axe.utils.preloadCssom({ treeRoot: treeRoot });
actual
- .then(function(cssom) {
+ .then(function (cssom) {
assert.isAtLeast(cssom.length, 2);
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(error);
});
});
- it('returns CSSOM and ensure that each object have defined properties', function(done) {
+ it('returns CSSOM and ensure that each object have defined properties', function (done) {
var actual = axe.utils.preloadCssom({ treeRoot: treeRoot });
actual
- .then(function(cssom) {
+ .then(function (cssom) {
assert.isAtLeast(cssom.length, 2);
- cssom.forEach(function(o) {
+ cssom.forEach(function (o) {
assert.hasAllKeys(o, [
'root',
'shadowId',
@@ -63,34 +63,34 @@ describe('axe.utils.preloadCssom', function() {
});
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(error);
});
});
- it('returns false if number of sheets returned does not match stylesheets defined in document', function(done) {
+ it('returns false if number of sheets returned does not match stylesheets defined in document', function (done) {
var actual = axe.utils.preloadCssom({ treeRoot: treeRoot });
actual
- .then(function(cssom) {
+ .then(function (cssom) {
assert.isFalse(cssom.length <= 1);
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(error);
});
});
- it('returns all stylesheets and ensure each sheet has property cssRules', function(done) {
+ it('returns all stylesheets and ensure each sheet has property cssRules', function (done) {
var actual = axe.utils.preloadCssom({ treeRoot: treeRoot });
actual
- .then(function(cssom) {
- cssom.forEach(function(s) {
+ .then(function (cssom) {
+ cssom.forEach(function (s) {
assert.isDefined(s.sheet);
assert.property(s.sheet, 'cssRules');
});
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(error);
});
});
diff --git a/test/core/utils/preload.js b/test/core/utils/preload.js
index a3a8f74317..7b2d20d3d5 100644
--- a/test/core/utils/preload.js
+++ b/test/core/utils/preload.js
@@ -1,28 +1,28 @@
-describe('axe.utils.preload', function() {
+describe('axe.utils.preload', function () {
'use strict';
var fixture = document.getElementById('fixture');
- beforeEach(function() {
+ beforeEach(function () {
axe.setup(fixture);
});
- it('returns `undefined` when `preload` option is set to false.', function(done) {
+ it('returns `undefined` when `preload` option is set to false.', function (done) {
var options = {
preload: false
};
var actual = axe.utils.preload(options);
actual
- .then(function(results) {
+ .then(function (results) {
assert.isUndefined(results);
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(error);
});
});
- it('returns assets with `cssom`, verify result is same output from `preloadCssom` fn', function(done) {
+ it('returns assets with `cssom`, verify result is same output from `preloadCssom` fn', function (done) {
var options = {
preload: {
assets: ['cssom']
@@ -30,11 +30,11 @@ describe('axe.utils.preload', function() {
};
var actual = axe.utils.preload(options);
actual
- .then(function(results) {
+ .then(function (results) {
assert.isDefined(results);
assert.property(results, 'cssom');
- axe.utils.preloadCssom(options).then(function(resultFromPreloadCssom) {
+ axe.utils.preloadCssom(options).then(function (resultFromPreloadCssom) {
assert.deepEqual(results.cssom, resultFromPreloadCssom);
done();
});
@@ -42,8 +42,8 @@ describe('axe.utils.preload', function() {
.catch(done);
});
- describe('axe.utils.shouldPreload', function() {
- it('should return true if preload configuration is valid', function() {
+ describe('axe.utils.shouldPreload', function () {
+ it('should return true if preload configuration is valid', function () {
var actual = axe.utils.shouldPreload({
preload: {
assets: ['cssom']
@@ -52,26 +52,26 @@ describe('axe.utils.preload', function() {
assert.isTrue(actual);
});
- it('should return true if preload is undefined', function() {
+ it('should return true if preload is undefined', function () {
var actual = axe.utils.shouldPreload({
preload: undefined
});
assert.isTrue(actual);
});
- it('should return true if preload is null', function() {
+ it('should return true if preload is null', function () {
var actual = axe.utils.shouldPreload({
preload: null
});
assert.isTrue(actual);
});
- it('should return true if preload is not set', function() {
+ it('should return true if preload is not set', function () {
var actual = axe.utils.shouldPreload({});
assert.isTrue(actual);
});
- it('should return false if preload configuration is invalid', function() {
+ it('should return false if preload configuration is invalid', function () {
var options = {
preload: {
errorProperty: ['cssom']
@@ -82,39 +82,39 @@ describe('axe.utils.preload', function() {
});
});
- describe('axe.utils.getPreloadConfig', function() {
- it('should return default assets if preload configuration is not set', function() {
+ describe('axe.utils.getPreloadConfig', function () {
+ it('should return default assets if preload configuration is not set', function () {
var actual = axe.utils.getPreloadConfig({}).assets;
var expected = ['cssom', 'media'];
assert.deepEqual(actual, expected);
});
- it('should return default assets if preload options is set to true', function() {
+ it('should return default assets if preload options is set to true', function () {
var actual = axe.utils.getPreloadConfig({}).assets;
var expected = ['cssom', 'media'];
assert.deepEqual(actual, expected);
});
- it('should return default timeout value if not configured', function() {
+ it('should return default timeout value if not configured', function () {
var actual = axe.utils.getPreloadConfig({}).timeout;
var expected = 10000;
assert.equal(actual, expected);
});
- it('should throw error if requested asset type is not supported', function() {
+ it('should throw error if requested asset type is not supported', function () {
var options = {
preload: {
assets: ['some-unsupported-asset']
}
};
- var actual = function() {
+ var actual = function () {
axe.utils.getPreloadConfig(options);
};
var expected = Error;
assert.throws(actual, expected);
});
- it('should remove any duplicate assets passed via preload configuration', function() {
+ it('should remove any duplicate assets passed via preload configuration', function () {
var options = {
preload: {
assets: ['cssom', 'cssom']
diff --git a/test/core/utils/process-message.js b/test/core/utils/process-message.js
index e7a222bb82..a5a4297e1b 100644
--- a/test/core/utils/process-message.js
+++ b/test/core/utils/process-message.js
@@ -1,9 +1,9 @@
-describe('axe.utils.processMessage', function() {
+describe('axe.utils.processMessage', function () {
'use strict';
var original = axe._audit;
- beforeEach(function() {
+ beforeEach(function () {
axe._audit = {
data: {
incompleteFallbackMessage: 'fallback message'
@@ -11,48 +11,48 @@ describe('axe.utils.processMessage', function() {
};
});
- after(function() {
+ after(function () {
axe._audit = original;
});
- it('should replace a ${data}', function() {
+ it('should replace a ${data}', function () {
var message = 'Hello ${data}';
var output = axe.utils.processMessage(message, 'World!');
assert.equal(output, 'Hello World!');
});
- it('should replace a ${ data } (with whitespace)', function() {
+ it('should replace a ${ data } (with whitespace)', function () {
var message = 'Hello ${ data }';
var output = axe.utils.processMessage(message, 'World!');
assert.equal(output, 'Hello World!');
});
- it('should replace ${data.prop}', function() {
+ it('should replace ${data.prop}', function () {
var message = 'Hello ${data.world}';
var output = axe.utils.processMessage(message, { world: 'World!' });
assert.equal(output, 'Hello World!');
});
- it('should replace ${data.prop}', function() {
+ it('should replace ${data.prop}', function () {
var message = 'Hello ${data.world}';
var output = axe.utils.processMessage(message, { world: undefined });
assert.equal(output, 'Hello ');
});
- it('should replace ${ data.prop } (with whitespace)', function() {
+ it('should replace ${ data.prop } (with whitespace)', function () {
var message = 'Hello ${ data.world }';
var output = axe.utils.processMessage(message, { world: 'World!' });
assert.equal(output, 'Hello World!');
});
- describe('data is array', function() {
- it('should replace ${data.values} with comma separated list of values', function() {
+ describe('data is array', function () {
+ it('should replace ${data.values} with comma separated list of values', function () {
var message = 'Output: ${data.values}';
var output = axe.utils.processMessage(message, ['one', 'two']);
assert.equal(output, 'Output: one, two');
});
- it('should handle singular message', function() {
+ it('should handle singular message', function () {
var message = {
singular: 'Singular message: ${data.values}',
plural: 'Plural messages: ${ data.values }'
@@ -61,7 +61,7 @@ describe('axe.utils.processMessage', function() {
assert.equal(output, 'Singular message: one');
});
- it('should handle plural message', function() {
+ it('should handle plural message', function () {
var message = {
singular: 'Singular message: ${data.values}',
plural: 'Plural messages: ${ data.values }'
@@ -71,8 +71,8 @@ describe('axe.utils.processMessage', function() {
});
});
- describe('message is object', function() {
- it('should handle message based on messageKey', function() {
+ describe('message is object', function () {
+ it('should handle message based on messageKey', function () {
var message = {
prop1: 'prop1 message',
prop2: 'prop2 message'
@@ -81,7 +81,7 @@ describe('axe.utils.processMessage', function() {
assert.equal(output, 'prop2 message');
});
- it('should replace ${data}', function() {
+ it('should replace ${data}', function () {
var message = {
prop1: 'prop1 message',
prop2: '${data.world} message'
@@ -93,7 +93,7 @@ describe('axe.utils.processMessage', function() {
assert.equal(output, 'World! message');
});
- it('should use default message', function() {
+ it('should use default message', function () {
var message = {
default: 'default message',
prop1: 'prop1 message',
@@ -103,7 +103,7 @@ describe('axe.utils.processMessage', function() {
assert.equal(output, 'default message');
});
- it('should use fallback message if no default', function() {
+ it('should use fallback message if no default', function () {
var message = {
prop1: 'prop1 message',
prop2: 'prop2 message'
diff --git a/test/core/utils/publish-metadata.js b/test/core/utils/publish-metadata.js
index 0f9cd8110a..2f6cdcc17e 100644
--- a/test/core/utils/publish-metadata.js
+++ b/test/core/utils/publish-metadata.js
@@ -1,15 +1,15 @@
-describe('axe.utils.publishMetaData', function() {
+describe('axe.utils.publishMetaData', function () {
'use strict';
- afterEach(function() {
+ afterEach(function () {
axe._audit = null;
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.publishMetaData);
});
- it('should pull data from rules from axe._audit.data', function() {
+ it('should pull data from rules from axe._audit.data', function () {
var expected = {
foo: 'bar',
bob: 'loblaw'
@@ -34,7 +34,7 @@ describe('axe.utils.publishMetaData', function() {
assert.equal(result.bob, expected.bob);
});
- it('should pull data from checks from axe._audit.data', function() {
+ it('should pull data from checks from axe._audit.data', function () {
var expected = {
foo: 'bar',
bob: 'loblaw'
@@ -68,13 +68,13 @@ describe('axe.utils.publishMetaData', function() {
assert.equal(result.nodes[0].any[0].bar, expected.bar);
});
- it('should execute messages', function() {
+ it('should execute messages', function () {
axe._load({
rules: [],
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -82,30 +82,30 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
}
}
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
}
}
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
}
}
@@ -215,13 +215,13 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should return default incomplete message with no reason specified by the check', function() {
+ it('should return default incomplete message with no reason specified by the check', function () {
axe._load({
rules: [],
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -229,10 +229,10 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
},
incomplete: {
@@ -245,10 +245,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
},
incomplete: {
@@ -261,10 +261,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
},
incomplete: {
@@ -343,16 +343,16 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should fall back to a generic message if incomplete object fails', function() {
+ it('should fall back to a generic message if incomplete object fails', function () {
axe._load({
rules: [],
data: {
- incompleteFallbackMessage: function() {
+ incompleteFallbackMessage: function () {
return 'Dogs are the best';
},
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -360,10 +360,10 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
},
incomplete: {}
@@ -371,10 +371,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
},
incomplete: {}
@@ -382,10 +382,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
},
incomplete: {}
@@ -459,13 +459,13 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should handle incomplete reasons', function() {
+ it('should handle incomplete reasons', function () {
axe._load({
rules: [],
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -473,10 +473,10 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
},
incomplete: {
@@ -489,10 +489,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
},
incomplete: {
@@ -505,10 +505,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
},
incomplete: {
@@ -599,13 +599,13 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should handle incomplete reasons with backwards compatibility', function() {
+ it('should handle incomplete reasons with backwards compatibility', function () {
axe._load({
rules: [],
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -613,10 +613,10 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
},
incomplete: {
@@ -629,10 +629,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
},
incomplete: {
@@ -645,10 +645,10 @@ describe('axe.utils.publishMetaData', function() {
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
},
incomplete: {
@@ -763,30 +763,30 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should not modify base configuration', function() {
+ it('should not modify base configuration', function () {
axe._load({
rules: [],
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
},
checks: {
'cats-PASS': {
- failureMessage: function() {
+ failureMessage: function () {
return 'cats-check';
}
},
'cats-ANY': {
- failureMessage: function() {
+ failureMessage: function () {
return 'cats-check2';
}
},
'cats-ALL': {
- failureMessage: function() {
+ failureMessage: function () {
return 'cats-check2';
}
}
@@ -824,7 +824,7 @@ describe('axe.utils.publishMetaData', function() {
assert.isNotNull(axe._audit.data.checks['cats-ALL'].failureMessage);
});
- it('should pull tags off rule object', function() {
+ it('should pull tags off rule object', function () {
var expected = {
foo: 'bar',
bob: 'loblaw'
@@ -862,8 +862,8 @@ describe('axe.utils.publishMetaData', function() {
assert.deepEqual(result.tags, ['hai']);
});
- describe('non-doT syntax', function() {
- it('should process ${data} syntax', function() {
+ describe('non-doT syntax', function () {
+ it('should process ${data} syntax', function () {
axe._load({
rules: [],
data: {
@@ -922,7 +922,7 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should return default incomplete message with no reason specified by the check', function() {
+ it('should return default incomplete message with no reason specified by the check', function () {
axe._load({
rules: [],
data: {
@@ -1036,7 +1036,7 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should fall back to a generic message if incomplete object fails', function() {
+ it('should fall back to a generic message if incomplete object fails', function () {
axe._load({
rules: [],
data: {
@@ -1137,7 +1137,7 @@ describe('axe.utils.publishMetaData', function() {
});
});
- it('should use fail message for rules with "reviewOnFaill: true"', function() {
+ it('should use fail message for rules with "reviewOnFaill: true"', function () {
axe._load({
rules: [
{
@@ -1148,7 +1148,7 @@ describe('axe.utils.publishMetaData', function() {
data: {
rules: {
cats: {
- help: function() {
+ help: function () {
return 'cats-rule';
}
}
@@ -1156,30 +1156,30 @@ describe('axe.utils.publishMetaData', function() {
checks: {
'cats-NONE': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-NONE';
},
- pass: function() {
+ pass: function () {
return 'pass-NONE';
}
}
},
'cats-ANY': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ANY';
},
- pass: function() {
+ pass: function () {
return 'pass-ANY';
}
}
},
'cats-ALL': {
messages: {
- fail: function() {
+ fail: function () {
return 'fail-ALL';
},
- pass: function() {
+ pass: function () {
return 'pass-ALL';
}
}
diff --git a/test/core/utils/qsa.js b/test/core/utils/qsa.js
index 4ff2cb0d1e..8a7e32c982 100644
--- a/test/core/utils/qsa.js
+++ b/test/core/utils/qsa.js
@@ -53,37 +53,37 @@ function getTestDom() {
return tree;
}
-describe('axe.utils.querySelectorAllFilter', function() {
+describe('axe.utils.querySelectorAllFilter', function () {
'use strict';
var dom;
- afterEach(function() {});
+ afterEach(function () {});
var tests = ['without cache', 'with cache'];
for (var i = 0; i < tests.length; i++) {
var describeName = tests[i];
- describe(describeName, function() {
- afterEach(function() {});
+ describe(describeName, function () {
+ afterEach(function () {});
if (describeName === 'without cache') {
- beforeEach(function() {
+ beforeEach(function () {
dom = getTestDom();
// prove we're using the DOM by deleting the cache
delete dom[0]._selectorCache;
});
- it('should not have a primed cache', function() {
+ it('should not have a primed cache', function () {
assert.isUndefined(dom[0]._selectorCache);
});
} else {
- beforeEach(function() {
+ beforeEach(function () {
dom = getTestDom();
// prove we're using the cache by deleting all the children
dom[0].children = [];
});
- it('should not use the cache if not using the top-level node', function() {
+ it('should not use the cache if not using the top-level node', function () {
var nodes = axe.utils.querySelectorAllFilter(dom, 'ul');
// this would return 4 nodes if we were still using the
@@ -93,46 +93,46 @@ describe('axe.utils.querySelectorAllFilter', function() {
});
}
- it('should find nodes using just the tag', function() {
+ it('should find nodes using just the tag', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'li');
assert.equal(result.length, 4);
});
- it('should find nodes using parent selector', function() {
+ it('should find nodes using parent selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'ul > li');
assert.equal(result.length, 4);
});
- it('should NOT find nodes using parent selector', function() {
+ it('should NOT find nodes using parent selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div > li');
assert.equal(result.length, 0);
});
- it('should find nodes using nested parent selectors', function() {
+ it('should find nodes using nested parent selectors', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'span > span > span > span'
);
assert.equal(result.length, 2);
});
- it('should find nodes using hierarchical selector', function() {
+ it('should find nodes using hierarchical selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div li');
assert.equal(result.length, 4);
});
- it('should find nodes using class selector', function() {
+ it('should find nodes using class selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '.breaking');
assert.equal(result.length, 2);
});
- it('should find nodes using hierarchical class selector', function() {
+ it('should find nodes using hierarchical class selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '.first .breaking');
assert.equal(result.length, 2);
});
- it('should NOT find nodes using hierarchical class selector', function() {
+ it('should NOT find nodes using hierarchical class selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '.second .breaking');
assert.equal(result.length, 0);
});
- it('should find nodes using multiple class selector', function() {
+ it('should find nodes using multiple class selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '.second.third');
assert.equal(result.length, 1);
});
- it('should find nodes using id', function() {
+ it('should find nodes using id', function () {
var result = axe.utils.querySelectorAllFilter(dom, '#one');
assert.equal(result.length, 1);
});
@@ -142,14 +142,14 @@ describe('axe.utils.querySelectorAllFilter', function() {
// with the cache, this only works when we are testing the full
// tree (i.e. without cache)
if (describeName === 'without cache') {
- it('should find nodes using id, but not in shadow DOM', function() {
+ it('should find nodes using id, but not in shadow DOM', function () {
var result = axe.utils.querySelectorAllFilter(
dom[0].children[0],
'#one'
);
assert.equal(result.length, 1);
});
- it('should find nodes using id, within a shadow DOM', function() {
+ it('should find nodes using id, within a shadow DOM', function () {
var result = axe.utils.querySelectorAllFilter(
dom[0].children[0].children[2],
'#one'
@@ -158,110 +158,110 @@ describe('axe.utils.querySelectorAllFilter', function() {
});
}
- it('should find nodes using attribute', function() {
+ it('should find nodes using attribute', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[role]');
assert.equal(result.length, 2);
});
- it('should find nodes using attribute with value', function() {
+ it('should find nodes using attribute with value', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[role=tab]');
assert.equal(result.length, 1);
});
- it('should find nodes using attribute with value', function() {
+ it('should find nodes using attribute with value', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[role="button"]');
assert.equal(result.length, 1);
});
- it('should find nodes using parent attribute with value', function() {
+ it('should find nodes using parent attribute with value', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'[data-a11yhero="faulkner"] > ul'
);
assert.equal(result.length, 1);
});
- it('should find nodes using hierarchical attribute with value', function() {
+ it('should find nodes using hierarchical attribute with value', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'[data-a11yhero="faulkner"] li'
);
assert.equal(result.length, 2);
});
- it('should find nodes using :not selector with class', function() {
+ it('should find nodes using :not selector with class', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div:not(.first)');
assert.equal(result.length, 2);
});
- it('should find nodes using :not selector with matching id', function() {
+ it('should find nodes using :not selector with matching id', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div:not(#one)');
assert.equal(result.length, 2);
});
- it('should find nodes using :not selector with matching attribute selector', function() {
+ it('should find nodes using :not selector with matching attribute selector', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not([data-a11yhero])'
);
assert.equal(result.length, 2);
});
- it('should find nodes using :not selector with matching attribute selector with value', function() {
+ it('should find nodes using :not selector with matching attribute selector with value', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not([data-a11yhero=faulkner])'
);
assert.equal(result.length, 2);
});
- it('should find nodes using :not selector with bogus attribute selector with value', function() {
+ it('should find nodes using :not selector with bogus attribute selector with value', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not([data-a11yhero=wilco])'
);
assert.equal(result.length, 3);
});
- it('should find nodes using :not selector with bogus id', function() {
+ it('should find nodes using :not selector with bogus id', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div:not(#thangy)');
assert.equal(result.length, 3);
});
- it('should find nodes using :not selector with attribute', function() {
+ it('should find nodes using :not selector with attribute', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'div:not([id])');
assert.equal(result.length, 2);
});
- it('should find nodes hierarchically using :not selector', function() {
+ it('should find nodes hierarchically using :not selector', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not(.first) li'
);
assert.equal(result.length, 2);
});
- it('should find same nodes hierarchically using more :not selector', function() {
+ it('should find same nodes hierarchically using more :not selector', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not(.first) li:not(.breaking)'
);
assert.equal(result.length, 2);
});
- it('should NOT find nodes hierarchically using :not selector', function() {
+ it('should NOT find nodes hierarchically using :not selector', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'div:not(.second) li:not(.breaking)'
);
assert.equal(result.length, 0);
});
- it('should find nodes using ^= attribute selector', function() {
+ it('should find nodes using ^= attribute selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[class^="sec"]');
assert.equal(result.length, 1);
});
- it('should find nodes using $= attribute selector', function() {
+ it('should find nodes using $= attribute selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[id$="ne"]');
assert.equal(result.length, 3);
});
- it('should find nodes using *= attribute selector', function() {
+ it('should find nodes using *= attribute selector', function () {
var result = axe.utils.querySelectorAllFilter(dom, '[role*="t"]');
assert.equal(result.length, 2);
});
- it('should put it all together', function() {
+ it('should put it all together', function () {
var result = axe.utils.querySelectorAllFilter(
dom,
'.first[data-a11yhero="faulkner"] > ul li.breaking'
);
assert.equal(result.length, 2);
});
- it('should find an element only once', function() {
+ it('should find an element only once', function () {
var divs = axe.utils.querySelectorAllFilter(dom, 'div');
var ones = axe.utils.querySelectorAllFilter(dom, '#one');
var divOnes = axe.utils.querySelectorAllFilter(dom, 'div, #one');
@@ -272,18 +272,20 @@ describe('axe.utils.querySelectorAllFilter', function() {
'Elements matching both parts of a selector should not be included twice'
);
});
- it('should return nodes sorted by document position', function() {
+ it('should return nodes sorted by document position', function () {
var result = axe.utils.querySelectorAllFilter(dom, 'ul, #one');
assert.equal(result[0].actualNode.nodeName, 'UL');
assert.equal(result[1].actualNode.nodeName, 'DIV');
assert.equal(result[2].actualNode.nodeName, 'UL');
});
- it('should filter the returned nodes when passed a filter function', function() {
- var result = axe.utils.querySelectorAllFilter(dom, 'ul, #one', function(
- node
- ) {
- return node.actualNode.nodeName !== 'UL';
- });
+ it('should filter the returned nodes when passed a filter function', function () {
+ var result = axe.utils.querySelectorAllFilter(
+ dom,
+ 'ul, #one',
+ function (node) {
+ return node.actualNode.nodeName !== 'UL';
+ }
+ );
assert.equal(result[0].actualNode.nodeName, 'DIV');
assert.equal(result.length, 1);
});
@@ -291,14 +293,14 @@ describe('axe.utils.querySelectorAllFilter', function() {
}
});
-describe('axe.utils.querySelectorAll', function() {
+describe('axe.utils.querySelectorAll', function () {
'use strict';
var dom;
- afterEach(function() {});
- beforeEach(function() {
+ afterEach(function () {});
+ beforeEach(function () {
dom = getTestDom();
});
- it('should find nodes using just the tag', function() {
+ it('should find nodes using just the tag', function () {
var result = axe.utils.querySelectorAll(dom, 'li');
assert.equal(result.length, 4);
});
diff --git a/test/core/utils/queue.js b/test/core/utils/queue.js
index 9b15d0e025..7db5437193 100644
--- a/test/core/utils/queue.js
+++ b/test/core/utils/queue.js
@@ -1,50 +1,50 @@
-describe('axe.utils.queue', function() {
+describe('axe.utils.queue', function () {
'use strict';
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.queue);
});
- describe('defer', function() {
- it('should be a function', function() {
+ describe('defer', function () {
+ it('should be a function', function () {
var q = axe.utils.queue();
assert.isFunction(q.defer);
});
- it('should push onto the "axe.utils.queue"', function(done) {
+ it('should push onto the "axe.utils.queue"', function (done) {
var q = axe.utils.queue();
- q.defer(function(resolve) {
- setTimeout(function() {
+ q.defer(function (resolve) {
+ setTimeout(function () {
resolve(1);
}, 0);
});
- q.defer(function(resolve) {
- setTimeout(function() {
+ q.defer(function (resolve) {
+ setTimeout(function () {
resolve(2);
}, 0);
});
- q.then(function(data) {
+ q.then(function (data) {
assert.deepEqual(data, [1, 2]);
done();
});
});
- it('should execute resolve immediately if defered functions are already complete', function() {
+ it('should execute resolve immediately if defered functions are already complete', function () {
var q = axe.utils.queue(),
complete = false;
- q.defer(function(resolve) {
+ q.defer(function (resolve) {
resolve(1);
});
- q.defer(function(resolve) {
+ q.defer(function (resolve) {
resolve(2);
});
- q.then(function(data) {
+ q.then(function (data) {
complete = true;
assert.deepEqual(data, [1, 2]);
});
@@ -52,41 +52,41 @@ describe('axe.utils.queue', function() {
assert.isTrue(complete);
});
- it('is chainable', function() {
+ it('is chainable', function () {
var q = axe.utils.queue();
assert.equal(
q,
- q.defer(function() {})
+ q.defer(function () {})
);
});
- it('throws if then was already called', function() {
- assert.throws(function() {
+ it('throws if then was already called', function () {
+ assert.throws(function () {
var q = axe.utils.queue();
- q.defer(function(resolve) {
+ q.defer(function (resolve) {
resolve();
});
- q.then(function() {});
+ q.then(function () {});
- q.defer(function(resolve) {
+ q.defer(function (resolve) {
resolve();
});
});
});
- it('can await another queue', function(done) {
+ it('can await another queue', function (done) {
var q1 = axe.utils.queue();
var q2 = axe.utils.queue();
- q1.defer(function(resolve) {
- setTimeout(function() {
+ q1.defer(function (resolve) {
+ setTimeout(function () {
resolve(123);
}, 10);
});
q2.defer(q1);
- q2.then(function(res) {
+ q2.then(function (res) {
// unwrap both queue results
assert.equal(res[0][0], 123);
done();
@@ -94,62 +94,62 @@ describe('axe.utils.queue', function() {
});
});
- describe('then', function() {
- it('should be a function', function() {
+ describe('then', function () {
+ it('should be a function', function () {
var q = axe.utils.queue();
assert.isFunction(q.then);
});
- it('should execute immediately if axe.utils.queue is complete', function() {
+ it('should execute immediately if axe.utils.queue is complete', function () {
var q = axe.utils.queue();
var result = false;
- q.then(function() {
+ q.then(function () {
result = true;
});
assert.isTrue(result);
});
- it('is chainable', function() {
+ it('is chainable', function () {
var q = axe.utils.queue();
assert.equal(
q,
- q.then(function() {})
+ q.then(function () {})
);
});
- it('throws when called more than once', function() {
- assert.throws(function() {
+ it('throws when called more than once', function () {
+ assert.throws(function () {
var q = axe.utils.queue();
- q.defer(function() {});
- q.then(function() {});
- q.then(function() {});
+ q.defer(function () {});
+ q.then(function () {});
+ q.then(function () {});
});
});
});
- describe('abort', function() {
- it('should be a function', function() {
+ describe('abort', function () {
+ it('should be a function', function () {
var q = axe.utils.queue();
assert.isFunction(q.abort);
});
- it('stops `then` from being called', function(done) {
+ it('stops `then` from being called', function (done) {
var q = axe.utils.queue();
- q.defer(function(resolve) {
- setTimeout(function() {
+ q.defer(function (resolve) {
+ setTimeout(function () {
resolve(true);
}, 100);
});
- q.then(function() {
+ q.then(function () {
assert.ok(false, 'should not execute');
});
- q.catch(function() {});
+ q.catch(function () {});
- setTimeout(function() {
+ setTimeout(function () {
var data = q.abort();
assert.ok(true, 'Queue aborted');
assert.isFunction(data[0]);
@@ -157,12 +157,12 @@ describe('axe.utils.queue', function() {
}, 1);
});
- it('sends a message to `catch`', function(done) {
+ it('sends a message to `catch`', function (done) {
var q = axe.utils.queue();
- q.defer(function() {});
+ q.defer(function () {});
- q.then(function() {});
- q.catch(function(err) {
+ q.then(function () {});
+ q.catch(function (err) {
assert.equal(err, 'Super sheep');
done();
});
@@ -171,27 +171,27 @@ describe('axe.utils.queue', function() {
});
});
- describe('catch', function() {
- it('is called when defer throws an error', function(done) {
+ describe('catch', function () {
+ it('is called when defer throws an error', function (done) {
var q = axe.utils.queue();
- q.defer(function() {
+ q.defer(function () {
throw 'error! 1';
});
- q.catch(function(e) {
+ q.catch(function (e) {
assert.equal(e, 'error! 1');
done();
});
});
- it('can catch error synchronously', function(done) {
+ it('can catch error synchronously', function (done) {
var q = axe.utils.queue();
var sync = true;
- q.defer(function() {
+ q.defer(function () {
throw 'error! 2';
});
- q.catch(function(e) {
+ q.catch(function (e) {
assert.equal(e, 'error! 2');
assert.ok(sync, 'error caught in sync');
done();
@@ -199,75 +199,75 @@ describe('axe.utils.queue', function() {
sync = false;
});
- it('is called when the reject method is called', function(done) {
+ it('is called when the reject method is called', function (done) {
/*eslint no-unused-vars: 0*/
var q = axe.utils.queue();
var errorsCaught = 0;
- q.defer(function(resolve, reject) {
- setTimeout(function() {
+ q.defer(function (resolve, reject) {
+ setTimeout(function () {
reject('error! 2');
}, 1);
});
- q.catch(function(e) {
+ q.catch(function (e) {
assert.equal(e, 'error! 2');
errorsCaught += 1;
done();
});
});
- it('will not run `then` if an error is thrown', function(done) {
+ it('will not run `then` if an error is thrown', function (done) {
var q = axe.utils.queue();
- q.defer(function() {
+ q.defer(function () {
throw 'error! 3';
});
- q.then(function() {
+ q.then(function () {
assert.ok(false, 'Should not be called');
});
- q.catch(function(e) {
+ q.catch(function (e) {
assert.equal(e, 'error! 3');
done();
});
});
- it('does not continue other tasks if an error occurs', function(done) {
+ it('does not continue other tasks if an error occurs', function (done) {
var q = axe.utils.queue();
var aborted;
- q.defer(function() {
+ q.defer(function () {
throw 'error! 3';
});
- q.defer(function() {
+ q.defer(function () {
aborted = false;
});
- q.then(function() {
+ q.then(function () {
assert.ok(false, 'Should not be called');
});
- q.catch(function(e) {
+ q.catch(function (e) {
assert.equal(e, 'error! 3');
});
- setTimeout(function() {
+ setTimeout(function () {
assert.notEqual(aborted, false);
done();
}, 30);
});
- it('is chainable', function() {
+ it('is chainable', function () {
var q = axe.utils.queue();
assert.equal(
q,
- q.catch(function() {})
+ q.catch(function () {})
);
});
- it('throws when called more than once', function() {
- assert.throws(function() {
+ it('throws when called more than once', function () {
+ assert.throws(function () {
var q = axe.utils.queue();
- q.defer(function() {});
- q.catch(function() {});
- q.catch(function() {});
+ q.defer(function () {});
+ q.catch(function () {});
+ q.catch(function () {});
});
});
});
diff --git a/test/core/utils/respondable.js b/test/core/utils/respondable.js
index 590cdb3641..f4e0897888 100644
--- a/test/core/utils/respondable.js
+++ b/test/core/utils/respondable.js
@@ -1,13 +1,13 @@
-describe('axe.utils.respondable', function() {
+describe('axe.utils.respondable', function () {
var fixture = document.querySelector('#fixture');
var respondable = axe.utils.respondable;
var noop = sinon.spy();
var frameWin;
- beforeEach(function(done) {
+ beforeEach(function (done) {
var frame = document.createElement('iframe');
frame.src = '../mock/frames/test.html';
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
frameWin = frame.contentWindow;
done();
});
@@ -16,12 +16,12 @@ describe('axe.utils.respondable', function() {
fixture.appendChild(frame);
});
- afterEach(function() {
+ afterEach(function () {
axe._thisWillBeDeletedDoNotUse.utils.setDefaultFrameMessenger(respondable);
});
- it('should error if open is not a function', function() {
- assert.throws(function() {
+ it('should error if open is not a function', function () {
+ assert.throws(function () {
respondable.updateMessenger({
post: noop,
close: noop
@@ -29,26 +29,26 @@ describe('axe.utils.respondable', function() {
});
});
- it('should error if post is not a function', function() {
- assert.throws(function() {
+ it('should error if post is not a function', function () {
+ assert.throws(function () {
respondable.updateMessenger({
open: noop
});
});
});
- it('should error if open function return is not a function', function() {
- assert.throws(function() {
+ it('should error if open function return is not a function', function () {
+ assert.throws(function () {
respondable.updateMessenger({
post: noop,
- open: function() {
+ open: function () {
return 1;
}
});
});
});
- it('should call the open function and pass the listener', function() {
+ it('should call the open function and pass the listener', function () {
var open = sinon.spy();
respondable.updateMessenger({
open: open,
@@ -59,10 +59,10 @@ describe('axe.utils.respondable', function() {
assert.isTrue(typeof open.args[0][0] === 'function');
});
- it('should call previous close function', function() {
+ it('should call previous close function', function () {
var close = sinon.spy();
respondable.updateMessenger({
- open: function() {
+ open: function () {
return close;
},
post: noop
@@ -76,7 +76,7 @@ describe('axe.utils.respondable', function() {
assert.isTrue(close.called);
});
- it('should use the post function when making a frame post', function() {
+ it('should use the post function when making a frame post', function () {
var post = sinon.spy();
respondable.updateMessenger({
open: noop,
@@ -87,7 +87,7 @@ describe('axe.utils.respondable', function() {
assert.isTrue(post.called);
});
- it('should pass the post function the correct parameters', function() {
+ it('should pass the post function the correct parameters', function () {
var post = sinon.spy();
var callback = sinon.spy();
@@ -110,15 +110,15 @@ describe('axe.utils.respondable', function() {
);
});
- it('should work as a full integration', function() {
+ it('should work as a full integration', function () {
var listeners = {};
var listener = sinon.spy();
respondable.updateMessenger({
- open: function() {
+ open: function () {
listeners.greeting = listener;
},
- post: function(win, data) {
+ post: function (win, data) {
if (listeners[data.topic]) {
listeners[data.topic]();
}
diff --git a/test/core/utils/rule-should-run.js b/test/core/utils/rule-should-run.js
index 42b5774461..ce5d1c04ff 100644
--- a/test/core/utils/rule-should-run.js
+++ b/test/core/utils/rule-should-run.js
@@ -1,7 +1,7 @@
-describe('axe.utils.ruleShouldRun', function() {
+describe('axe.utils.ruleShouldRun', function () {
'use strict';
- it('should return false if rule.pageOnly and !context.page', function() {
+ it('should return false if rule.pageOnly and !context.page', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -15,7 +15,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if rule.enabled is false, option.enabled is false and ruleID is not present runOnly', function() {
+ it('should return false if rule.enabled is false, option.enabled is false and ruleID is not present runOnly', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -38,7 +38,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return true if rule.enabled is false, option.enabled is false and ruleID is present in runOnly', function() {
+ it('should return true if rule.enabled is false, option.enabled is false and ruleID is present in runOnly', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -61,7 +61,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return true if rule.enabled is false, option is undefined and ruleID is present in runOnly', function() {
+ it('should return true if rule.enabled is false, option is undefined and ruleID is present in runOnly', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -79,7 +79,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false even if enabled is set to true if ruleID is not present in runOnly', function() {
+ it('should return false even if enabled is set to true if ruleID is not present in runOnly', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -97,7 +97,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if rule.enabled is false', function() {
+ it('should return false if rule.enabled is false', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -111,7 +111,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return true if rule.enabled is true', function() {
+ it('should return true if rule.enabled is true', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -125,7 +125,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return true if option is set to true but rule is set to false', function() {
+ it('should return true if option is set to true but rule is set to false', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -144,7 +144,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if option is set to false but rule is set to true', function() {
+ it('should return false if option is set to false but rule is set to true', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -163,7 +163,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should use option.rules.enabled over option.runOnly tags', function() {
+ it('should use option.rules.enabled over option.runOnly tags', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -209,21 +209,21 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- describe('default axe._tagExclude', function() {
+ describe('default axe._tagExclude', function () {
var origTagExclude;
- before(function() {
+ before(function () {
axe._load({});
origTagExclude = axe._audit.tagExclude;
});
- after(function() {
+ after(function () {
axe._audit.tagExclude = origTagExclude;
});
- beforeEach(function() {
+ beforeEach(function () {
axe._audit.tagExclude = [];
});
- it('excludes rules with a tag put in axe._tagExclude', function() {
+ it('excludes rules with a tag put in axe._tagExclude', function () {
axe._audit.tagExclude = ['the-cheat'];
assert.isTrue(
axe.utils.ruleShouldRun(
@@ -250,7 +250,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('adds axe.tagExclude to the existing exclude tags', function() {
+ it('adds axe.tagExclude to the existing exclude tags', function () {
axe._audit.tagExclude = ['the-cheat'];
assert.isFalse(
axe.utils.ruleShouldRun(
@@ -270,7 +270,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('does not exclude tags explicitly included', function() {
+ it('does not exclude tags explicitly included', function () {
axe._audit.tagExclude = ['the-cheat'];
assert.isTrue(
axe.utils.ruleShouldRun(
@@ -326,8 +326,8 @@ describe('axe.utils.ruleShouldRun', function() {
});
});
- describe('runOnly type:tag', function() {
- it('should return true if passed an array with a matching tag', function() {
+ describe('runOnly type:tag', function () {
+ it('should return true if passed an array with a matching tag', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -346,7 +346,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if passed an array with a matching tag', function() {
+ it('should return false if passed an array with a matching tag', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -365,7 +365,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should accept string as an include value', function() {
+ it('should accept string as an include value', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -386,7 +386,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should accept array as an include value', function() {
+ it('should accept array as an include value', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -407,7 +407,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should accept string as an exclude value', function() {
+ it('should accept string as an exclude value', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -428,7 +428,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should accept array as an exclude value', function() {
+ it('should accept array as an exclude value', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -449,7 +449,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return true if it matches include but not exclude', function() {
+ it('should return true if it matches include but not exclude', function () {
assert.isTrue(
axe.utils.ruleShouldRun(
{
@@ -471,7 +471,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if it matches no include', function() {
+ it('should return false if it matches no include', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
@@ -493,7 +493,7 @@ describe('axe.utils.ruleShouldRun', function() {
);
});
- it('should return false if it matches include and exclude', function() {
+ it('should return false if it matches include and exclude', function () {
assert.isFalse(
axe.utils.ruleShouldRun(
{
diff --git a/test/core/utils/scroll-state.js b/test/core/utils/scroll-state.js
index ec4714a7e4..e22534892c 100644
--- a/test/core/utils/scroll-state.js
+++ b/test/core/utils/scroll-state.js
@@ -1,11 +1,11 @@
-describe('axe.utils.getScrollState', function() {
+describe('axe.utils.getScrollState', function () {
'use strict';
var mockWin;
var getScrollState = axe.utils.getScrollState;
var fixture = document.getElementById('fixture');
- beforeEach(function() {
+ beforeEach(function () {
mockWin = {
pageXOffset: 1,
pageYOffset: 3,
@@ -21,15 +21,15 @@ describe('axe.utils.getScrollState', function() {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(getScrollState);
});
- it('takes the window object as an optional argument', function() {
+ it('takes the window object as an optional argument', function () {
assert.deepEqual(getScrollState(), getScrollState(window));
});
- it('returns the window as the first item, if pageXOffset is supported', function() {
+ it('returns the window as the first item, if pageXOffset is supported', function () {
assert.deepEqual(getScrollState(mockWin)[0], {
elm: mockWin,
top: mockWin.pageYOffset,
@@ -37,7 +37,7 @@ describe('axe.utils.getScrollState', function() {
});
});
- it('returns the html as the first item, if pageXOffset is not supported', function() {
+ it('returns the html as the first item, if pageXOffset is not supported', function () {
mockWin.pageYOffset = undefined;
mockWin.pageXOffset = undefined;
var html = mockWin.document.documentElement;
@@ -49,7 +49,7 @@ describe('axe.utils.getScrollState', function() {
});
});
- it('grabs scrollTop and scrollLeft from all descendants of body', function() {
+ it('grabs scrollTop and scrollLeft from all descendants of body', function () {
fixture.innerHTML =
'
' +
'
Han Solo
' +
@@ -66,20 +66,20 @@ describe('axe.utils.getScrollState', function() {
var scrollState = getScrollState();
assert.deepEqual(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt1;
}),
{ elm: tgt1, top: 10, left: 0 }
);
assert.deepEqual(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt2;
}),
{ elm: tgt2, top: 20, left: 0 }
);
});
- it('ignores elements with overflow visible', function() {
+ it('ignores elements with overflow visible', function () {
fixture.innerHTML =
'
' +
'
Han Solo
' +
@@ -90,18 +90,18 @@ describe('axe.utils.getScrollState', function() {
var scrollState = getScrollState();
assert.isUndefined(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt1;
})
);
assert.isUndefined(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt2;
})
);
});
- it('ignores elements that do not overflow', function() {
+ it('ignores elements that do not overflow', function () {
fixture.innerHTML =
'
' +
'
Han Solo
' +
@@ -115,43 +115,43 @@ describe('axe.utils.getScrollState', function() {
var scrollState = getScrollState();
assert.isUndefined(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt1;
})
);
assert.isUndefined(
- scrollState.find(function(scroll) {
+ scrollState.find(function (scroll) {
return scroll.elm === tgt2;
})
);
});
- it('does not fail with svg elements', function() {
+ it('does not fail with svg elements', function () {
fixture.innerHTML =
'
' +
' ' +
' ';
- assert.doesNotThrow(function() {
+ assert.doesNotThrow(function () {
getScrollState();
});
});
});
-describe('axe.utils.setScrollState', function() {
+describe('axe.utils.setScrollState', function () {
'use strict';
var setScrollState = axe.utils.setScrollState;
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(setScrollState);
});
- it('sets scrollTop and scrollLeft for regular nodes', function() {
+ it('sets scrollTop and scrollLeft for regular nodes', function () {
var elm1 = {},
elm2 = {};
setScrollState([
@@ -163,10 +163,10 @@ describe('axe.utils.setScrollState', function() {
assert.deepEqual(elm2, { scrollTop: 30, scrollLeft: 40 });
});
- it('calls scroll() for the window element', function() {
+ it('calls scroll() for the window element', function () {
var called;
var winScroll = window.scroll;
- window.scroll = function(left, top) {
+ window.scroll = function (left, top) {
called = { top: top, left: left };
};
setScrollState([{ elm: window, top: 10, left: 20 }]);
diff --git a/test/core/utils/select.js b/test/core/utils/select.js
index 52acfb51ad..8d0d9c7559 100644
--- a/test/core/utils/select.js
+++ b/test/core/utils/select.js
@@ -1,4 +1,4 @@
-describe('axe.utils.select', function() {
+describe('axe.utils.select', function () {
'use strict';
function $id(id) {
@@ -7,21 +7,21 @@ describe('axe.utils.select', function() {
var fixture = document.getElementById('fixture');
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe._selectCache = undefined;
});
- it('should be a function', function() {
+ it('should be a function', function () {
assert.isFunction(axe.utils.select);
});
- it('should return an array', function() {
+ it('should return an array', function () {
assert.isArray(axe.utils.select('div', { include: [] }));
});
- describe('selector', function() {
- it('should accept a selector', function() {
+ describe('selector', function () {
+ it('should accept a selector', function () {
var div = document.createElement('div');
div.id = 'monkeys';
fixture.appendChild(div);
@@ -34,8 +34,8 @@ describe('axe.utils.select', function() {
});
});
- describe('context', function() {
- it('should include', function() {
+ describe('context', function () {
+ it('should include', function () {
fixture.innerHTML =
'
';
@@ -46,7 +46,7 @@ describe('axe.utils.select', function() {
assert.deepEqual([result[0].actualNode], [$id('bananas')]);
});
- it('should exclude', function() {
+ it('should exclude', function () {
fixture.innerHTML =
'
';
@@ -58,7 +58,7 @@ describe('axe.utils.select', function() {
assert.deepEqual(result, []);
});
- it('should pick the deepest exclude/include - exclude winning', function() {
+ it('should pick the deepest exclude/include - exclude winning', function () {
fixture.innerHTML =
'
' +
'
' +
@@ -84,7 +84,7 @@ describe('axe.utils.select', function() {
assert.deepEqual(result, []);
});
- it('should pick the deepest exclude/include - include winning', function() {
+ it('should pick the deepest exclude/include - include winning', function () {
fixture.innerHTML =
'
' +
'
' +
@@ -114,7 +114,7 @@ describe('axe.utils.select', function() {
});
});
- it('should only contain unique elements', function() {
+ it('should only contain unique elements', function () {
fixture.innerHTML =
'
';
var tree = axe.utils.getFlattenedTree($id('fixture'))[0];
@@ -127,7 +127,7 @@ describe('axe.utils.select', function() {
assert.equal(result[0].actualNode, $id('bananas'));
});
- it('should not return duplicates on overlapping includes', function() {
+ it('should not return duplicates on overlapping includes', function () {
fixture.innerHTML =
'
';
@@ -140,7 +140,7 @@ describe('axe.utils.select', function() {
});
assert.deepEqual(
- result.map(function(n) {
+ result.map(function (n) {
return n.actualNode;
}),
[$id('target1'), $id('target2')]
@@ -148,7 +148,7 @@ describe('axe.utils.select', function() {
assert.equal(result.length, 2);
});
- it('should return the cached result if one exists', function() {
+ it('should return the cached result if one exists', function () {
fixture.innerHTML =
'
';
diff --git a/test/core/utils/selector-cache.js b/test/core/utils/selector-cache.js
index c0b7bfaf1b..9e6e70deeb 100644
--- a/test/core/utils/selector-cache.js
+++ b/test/core/utils/selector-cache.js
@@ -1,4 +1,4 @@
-describe('utils.selector-cache', function() {
+describe('utils.selector-cache', function () {
var fixture = document.querySelector('#fixture');
var cacheNodeSelectors =
axe._thisWillBeDeletedDoNotUse.utils.cacheNodeSelectors;
@@ -8,25 +8,25 @@ describe('utils.selector-cache', function() {
var shadowSupported = axe.testUtils.shadowSupport.v1;
var vNode;
- beforeEach(function() {
+ beforeEach(function () {
fixture.innerHTML = '
';
vNode = new axe.VirtualNode(fixture.firstChild);
});
- describe('cacheNodeSelectors', function() {
- it('should add the node to the global selector', function() {
+ describe('cacheNodeSelectors', function () {
+ it('should add the node to the global selector', function () {
var map = {};
cacheNodeSelectors(vNode, map);
assert.deepEqual(map['*'], [vNode]);
});
- it('should add the node to the nodeName', function() {
+ it('should add the node to the nodeName', function () {
var map = {};
cacheNodeSelectors(vNode, map);
assert.deepEqual(map.div, [vNode]);
});
- it('should add the node to all attribute selectors', function() {
+ it('should add the node to all attribute selectors', function () {
var map = {};
cacheNodeSelectors(vNode, map);
assert.deepEqual(map['[id]'], [vNode]);
@@ -34,20 +34,20 @@ describe('utils.selector-cache', function() {
assert.deepEqual(map['[aria-label]'], [vNode]);
});
- it('should add the node to the id map', function() {
+ it('should add the node to the id map', function () {
var map = {};
cacheNodeSelectors(vNode, map);
assert.deepEqual(map[' [idsMap]'].target, [vNode]);
});
- it('should not add the node to selectors it does not match', function() {
+ it('should not add the node to selectors it does not match', function () {
var map = {};
cacheNodeSelectors(vNode, map);
assert.isUndefined(map['[for]']);
assert.isUndefined(map.h1);
});
- it('should ignore non-element nodes', function() {
+ it('should ignore non-element nodes', function () {
var map = {};
fixture.innerHTML = 'Hello';
vNode = new axe.VirtualNode(fixture.firstChild);
@@ -57,7 +57,7 @@ describe('utils.selector-cache', function() {
});
});
- describe('getNodesMatchingExpression', function() {
+ describe('getNodesMatchingExpression', function () {
var tree;
var spanVNode;
var headingVNode;
@@ -77,7 +77,7 @@ describe('utils.selector-cache', function() {
return axe.utils.getFlattenedTree(fixture);
}
- beforeEach(function() {
+ beforeEach(function () {
fixture.firstChild.innerHTML =
'
';
tree = axe.utils.getFlattenedTree(fixture.firstChild);
@@ -87,13 +87,13 @@ describe('utils.selector-cache', function() {
spanVNode = headingVNode.children[0];
});
- it('should return undefined if the cache is not primed', function() {
+ it('should return undefined if the cache is not primed', function () {
tree[0]._selectorMap = null;
var expression = convertSelector('div');
assert.isUndefined(getNodesMatchingExpression(tree, expression));
});
- it('should return a list of matching nodes by global selector', function() {
+ it('should return a list of matching nodes by global selector', function () {
var expression = convertSelector('*');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [
vNode,
@@ -102,19 +102,19 @@ describe('utils.selector-cache', function() {
]);
});
- it('should return a list of matching nodes by nodeName', function() {
+ it('should return a list of matching nodes by nodeName', function () {
var expression = convertSelector('div');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
- it('should return a list of matching nodes by id', function() {
+ it('should return a list of matching nodes by id', function () {
var expression = convertSelector('#target');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
(shadowSupported ? it : xit)(
'should only return nodes matching shadowId when matching by id',
- function() {
+ function () {
fixture.innerHTML =
'
';
var tree = createTree();
@@ -127,32 +127,32 @@ describe('utils.selector-cache', function() {
}
);
- it('should return a list of matching nodes by class', function() {
+ it('should return a list of matching nodes by class', function () {
var expression = convertSelector('.foo');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
- it('should return a list of matching nodes by attribute', function() {
+ it('should return a list of matching nodes by attribute', function () {
var expression = convertSelector('[aria-label]');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
- it('should return an empty array if selector does not match', function() {
+ it('should return an empty array if selector does not match', function () {
var expression = convertSelector('main');
assert.lengthOf(getNodesMatchingExpression(tree, expression), 0);
});
- it('should return an empty array for complex selector that does not match', function() {
+ it('should return an empty array for complex selector that does not match', function () {
var expression = convertSelector('span.missingClass[id]');
assert.lengthOf(getNodesMatchingExpression(tree, expression), 0);
});
- it('should return an empty array for a non-complex selector that does not match', function() {
+ it('should return an empty array for a non-complex selector that does not match', function () {
var expression = convertSelector('div#not-target[id]');
assert.lengthOf(getNodesMatchingExpression(tree, expression), 0);
});
- it('should return nodes for each expression', function() {
+ it('should return nodes for each expression', function () {
fixture.innerHTML =
'
';
var tree = createTree();
@@ -161,41 +161,41 @@ describe('utils.selector-cache', function() {
assert.deepEqual(getNodesMatchingExpression(tree, expression), expected);
});
- it('should return nodes for child combinator selector', function() {
+ it('should return nodes for child combinator selector', function () {
var expression = convertSelector('div span');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [
spanVNode
]);
});
- it('should return nodes for direct child combinator selector', function() {
+ it('should return nodes for direct child combinator selector', function () {
var expression = convertSelector('div > h1');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [
headingVNode
]);
});
- it('should not return nodes for direct child combinator selector that does not match', function() {
+ it('should not return nodes for direct child combinator selector that does not match', function () {
var expression = convertSelector('div > span');
assert.lengthOf(getNodesMatchingExpression(tree, expression), 0);
});
- it('should return nodes for attribute value selector', function() {
+ it('should return nodes for attribute value selector', function () {
var expression = convertSelector('[id="target"]');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
- it('should return undefined for combinator selector with global selector', function() {
+ it('should return undefined for combinator selector with global selector', function () {
var expression = convertSelector('body *');
assert.isUndefined(getNodesMatchingExpression(tree, expression));
});
- it('should return nodes for multipart selectors', function() {
+ it('should return nodes for multipart selectors', function () {
var expression = convertSelector('div.foo[id]');
assert.deepEqual(getNodesMatchingExpression(tree, expression), [vNode]);
});
- it('should remove duplicates', function() {
+ it('should remove duplicates', function () {
fixture.innerHTML = '
';
var tree = createTree();
var expression = convertSelector('div[role], [aria-label]');
@@ -203,7 +203,7 @@ describe('utils.selector-cache', function() {
assert.deepEqual(getNodesMatchingExpression(tree, expression), expected);
});
- it('should sort nodes by added order', function() {
+ it('should sort nodes by added order', function () {
fixture.innerHTML =
'
' +
'
' +
@@ -239,7 +239,7 @@ describe('utils.selector-cache', function() {
]);
});
- it('should filter nodes', function() {
+ it('should filter nodes', function () {
fixture.innerHTML =
'
';
var tree = createTree();
diff --git a/test/core/utils/send-command-to-frame.js b/test/core/utils/send-command-to-frame.js
index 4b9eddd970..7cc1e109bf 100644
--- a/test/core/utils/send-command-to-frame.js
+++ b/test/core/utils/send-command-to-frame.js
@@ -1,32 +1,32 @@
-describe('axe.utils.sendCommandToFrame', function() {
+describe('axe.utils.sendCommandToFrame', function () {
'use strict';
var fixture = document.getElementById('fixture');
var params = { command: 'rules' };
var captureError = axe.testUtils.captureError;
- afterEach(function() {
+ afterEach(function () {
fixture.innerHTML = '';
axe._tree = undefined;
axe._selectorData = undefined;
});
- var assertNotCalled = function() {
+ var assertNotCalled = function () {
assert.ok(false, 'should not be called');
};
- it('should return results from frames', function(done) {
+ it('should return results from frames', function (done) {
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
axe.utils.sendCommandToFrame(
frame,
params,
- captureError(function(res) {
+ captureError(function (res) {
assert.lengthOf(res, 1);
assert.equal(res[0].id, 'html');
done();
}, done),
- function() {
+ function () {
done(new Error('sendCommandToFrame should not error'));
}
);
@@ -37,16 +37,16 @@ describe('axe.utils.sendCommandToFrame', function() {
fixture.appendChild(frame);
});
- it('adjusts skips ping with options.pingWaitTime=0', function(done) {
+ it('adjusts skips ping with options.pingWaitTime=0', function (done) {
var frame = document.createElement('iframe');
var params = {
command: 'rules',
options: { pingWaitTime: 0 }
};
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
var topics = [];
- frame.contentWindow.addEventListener('message', function(event) {
+ frame.contentWindow.addEventListener('message', function (event) {
try {
topics.push(JSON.parse(event.data).topic);
} catch (_) {
@@ -56,7 +56,7 @@ describe('axe.utils.sendCommandToFrame', function() {
axe.utils.sendCommandToFrame(
frame,
params,
- captureError(function() {
+ captureError(function () {
try {
assert.deepEqual(topics, ['axe.start']);
done();
@@ -64,7 +64,7 @@ describe('axe.utils.sendCommandToFrame', function() {
done(e);
}
}, done),
- function() {
+ function () {
done(new Error('sendCommandToFrame should not error'));
}
);
@@ -75,9 +75,9 @@ describe('axe.utils.sendCommandToFrame', function() {
fixture.appendChild(frame);
});
- it('should timeout if there is no response from frame', function(done) {
+ it('should timeout if there is no response from frame', function (done) {
var orig = window.setTimeout;
- window.setTimeout = function(fn, to) {
+ window.setTimeout = function (fn, to) {
if (to === 30000) {
assert.ok('timeout set');
fn();
@@ -89,12 +89,12 @@ describe('axe.utils.sendCommandToFrame', function() {
};
var frame = document.createElement('iframe');
- frame.addEventListener('load', function() {
+ frame.addEventListener('load', function () {
axe._tree = axe.utils.getFlattenedTree(document.documentElement);
axe.utils.sendCommandToFrame(
frame,
params,
- function(result) {
+ function (result) {
assert.equal(result, null);
done();
},
diff --git a/test/core/utils/shadow-select.js b/test/core/utils/shadow-select.js
index 574d385b65..bc9488d9cd 100644
--- a/test/core/utils/shadow-select.js
+++ b/test/core/utils/shadow-select.js
@@ -1,5 +1,5 @@
var shadowSupported = axe.testUtils.shadowSupport.v1;
-var testSuite = (shadowSupported ? describe : describe.skip)
+var testSuite = shadowSupported ? describe : describe.skip;
testSuite('utils.shadowSelect', function () {
var shadowSelect = axe.utils.shadowSelect;
@@ -46,7 +46,7 @@ testSuite('utils.shadowSelect', function () {
});
it('returns null if the node does not exist in the shadow tree', function () {
- var shadowRoot = appendShadowTree(fixture, 'div')
+ var shadowRoot = appendShadowTree(fixture, 'div');
shadowRoot.innerHTML = '
';
assert.isNull(shadowSelect(['#fixture > div', '.goodbye']));
});
@@ -80,10 +80,10 @@ testSuite('utils.shadowSelect', function () {
root.innerHTML = '
';
var node = shadowSelect([
- '#fixture > article',
- 'section',
- 'div',
- 'p',
+ '#fixture > article',
+ 'section',
+ 'div',
+ 'p',
'.hello'
]);
assert.equal(node.nodeName.toLowerCase(), 'b');
diff --git a/test/core/utils/to-array.js b/test/core/utils/to-array.js
index 7e1a62ac3d..e60971286f 100644
--- a/test/core/utils/to-array.js
+++ b/test/core/utils/to-array.js
@@ -1,11 +1,11 @@
-describe('axe.utils.toArray', function() {
+describe('axe.utils.toArray', function () {
'use strict';
- it('should call Array.prototype.slice', function() {
+ it('should call Array.prototype.slice', function () {
var orig = Array.prototype.slice,
called = false,
- arrayLike = { '0': 'cats', length: 1 };
+ arrayLike = { 0: 'cats', length: 1 };
- Array.prototype.slice = function() {
+ Array.prototype.slice = function () {
called = true;
assert.equal(this, arrayLike);
};
@@ -17,18 +17,18 @@ describe('axe.utils.toArray', function() {
Array.prototype.slice = orig;
});
- it('should return an array', function() {
- var arrayLike = { '0': 'cats', length: 1 };
+ it('should return an array', function () {
+ var arrayLike = { 0: 'cats', length: 1 };
var result = axe.utils.toArray(arrayLike);
assert.isArray(result);
});
});
-describe('axe.utils.uniqueArray', function() {
+describe('axe.utils.uniqueArray', function () {
'use strict';
- it('should filter duplicate values', function() {
+ it('should filter duplicate values', function () {
var array1 = [1, 2, 3, 4, 5];
var array2 = [1, 3, 7];
diff --git a/test/core/utils/token-list.js b/test/core/utils/token-list.js
index 93e224a0fe..6606b03db4 100644
--- a/test/core/utils/token-list.js
+++ b/test/core/utils/token-list.js
@@ -1,7 +1,7 @@
-describe('axe.utils.tokenList', function() {
+describe('axe.utils.tokenList', function () {
'use strict';
- it('should split by space', function() {
+ it('should split by space', function () {
assert.deepEqual(axe.utils.tokenList('bananas monkeys 42'), [
'bananas',
'monkeys',
@@ -9,7 +9,7 @@ describe('axe.utils.tokenList', function() {
]);
});
- it('should trim first', function() {
+ it('should trim first', function () {
assert.deepEqual(axe.utils.tokenList(' \r bananas monkeys 42 \n '), [
'bananas',
'monkeys',
@@ -17,7 +17,7 @@ describe('axe.utils.tokenList', function() {
]);
});
- it('should collapse whitespace', function() {
+ it('should collapse whitespace', function () {
assert.deepEqual(axe.utils.tokenList(' \r bananas \r \n monkeys 42 \n '), [
'bananas',
'monkeys',
@@ -25,7 +25,7 @@ describe('axe.utils.tokenList', function() {
]);
});
- it('should return empty string array for null value', function() {
+ it('should return empty string array for null value', function () {
assert.deepEqual(axe.utils.tokenList(null), ['']);
});
});
diff --git a/test/core/utils/valid-langs.js b/test/core/utils/valid-langs.js
index 880cc3095e..0cb0c5b517 100644
--- a/test/core/utils/valid-langs.js
+++ b/test/core/utils/valid-langs.js
@@ -1,46 +1,46 @@
-describe('axe.utils.isValidLang', function() {
+describe('axe.utils.isValidLang', function () {
'use strict';
- describe('isValidLang', function() {
- it('should return true for valid 3-character lang', function() {
+ describe('isValidLang', function () {
+ it('should return true for valid 3-character lang', function () {
assert.isTrue(axe.utils.isValidLang('bbb'));
});
- it('should return true for valid 2-character lang', function() {
+ it('should return true for valid 2-character lang', function () {
assert.isTrue(axe.utils.isValidLang('aa'));
});
- it('should return false for invalid lang', function() {
+ it('should return false for invalid lang', function () {
assert.isFalse(axe.utils.isValidLang('xyz'));
});
- it('should return false for invalid 2-character lang', function() {
+ it('should return false for invalid 2-character lang', function () {
assert.isFalse(axe.utils.isValidLang('bb'));
});
- it('should return false for invalid 1-character lang code', function() {
+ it('should return false for invalid 1-character lang code', function () {
assert.isFalse(axe.utils.isValidLang('a'));
});
- it('should return false for invalid 4-character lang code', function() {
+ it('should return false for invalid 4-character lang code', function () {
assert.isFalse(axe.utils.isValidLang('abcd'));
});
- it('should return false for empty string', function() {
+ it('should return false for empty string', function () {
assert.isFalse(axe.utils.isValidLang(''));
});
- it('should return false for invalid lang code', function() {
+ it('should return false for invalid lang code', function () {
assert.isFalse(axe.utils.isValidLang('123'));
});
});
- describe('validLangs', function() {
- it('should return an array of langs', function() {
+ describe('validLangs', function () {
+ it('should return an array of langs', function () {
assert.isTrue(Array.isArray(axe.utils.validLangs()));
});
- it('should include valid langs', function() {
+ it('should include valid langs', function () {
var langs = axe.utils.validLangs();
assert.isTrue(langs.indexOf('aaa') !== -1);
assert.isTrue(langs.indexOf('aa') !== -1);
diff --git a/test/integration/adapter.js b/test/integration/adapter.js
index c50fa527f6..d082612253 100644
--- a/test/integration/adapter.js
+++ b/test/integration/adapter.js
@@ -1,15 +1,15 @@
/*global mocha */
var failedTests = [];
-(function() {
+(function () {
'use strict';
var runner = mocha.run();
- runner.on('end', function() {
+ runner.on('end', function () {
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});
runner.on('fail', function logFailure(test, err) {
- var flattenTitles = function(test) {
+ var flattenTitles = function (test) {
var titles = [];
while (test.parent.title) {
titles.push(test.parent.title);
diff --git a/test/integration/full/README.md b/test/integration/full/README.md
index 16aaadcde1..c09792bc89 100644
--- a/test/integration/full/README.md
+++ b/test/integration/full/README.md
@@ -10,4 +10,4 @@ To run the full integration tests, run `npm run test:integration`. Different bro
Because the full integration tests are not run using Mocha, Mocha styles and scripts, Chai, axe-core, [testutils.js](../../tesstutils.js), and the [adapter.js](../adapter.js) file will need to be loaded on the page.
-If the Mocha output would interfere with the axe-core results, you can load the [no-ui-reporter.js](../no-ui-reporter.js) to hide the Mocha test output in the browser UI and instead report the results in the browsers devtools console.
\ No newline at end of file
+If the Mocha output would interfere with the axe-core results, you can load the [no-ui-reporter.js](../no-ui-reporter.js) to hide the Mocha test output in the browser UI and instead report the results in the browsers devtools console.
diff --git a/test/integration/full/aria-hidden-body/fail.js b/test/integration/full/aria-hidden-body/fail.js
index 17b60c2ab9..4a0a54a23d 100644
--- a/test/integration/full/aria-hidden-body/fail.js
+++ b/test/integration/full/aria-hidden-body/fail.js
@@ -1,11 +1,11 @@
-describe('aria-hidden on body test ' + window.location.pathname, function() {
+describe('aria-hidden on body test ' + window.location.pathname, function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{ runOnly: { type: 'rule', values: ['aria-hidden-body'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -14,8 +14,8 @@ describe('aria-hidden on body test ' + window.location.pathname, function() {
});
});
- describe('violations', function() {
- it('should find some', function() {
+ describe('violations', function () {
+ it('should find some', function () {
assert.lengthOf(results.violations, 1);
});
});
diff --git a/test/integration/full/aria-hidden-body/pass.js b/test/integration/full/aria-hidden-body/pass.js
index 900be8ac94..5b58b23751 100644
--- a/test/integration/full/aria-hidden-body/pass.js
+++ b/test/integration/full/aria-hidden-body/pass.js
@@ -1,11 +1,11 @@
-describe('aria-hidden on body test ' + window.location.pathname, function() {
+describe('aria-hidden on body test ' + window.location.pathname, function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{ runOnly: { type: 'rule', values: ['aria-hidden-body'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -14,14 +14,14 @@ describe('aria-hidden on body test ' + window.location.pathname, function() {
});
});
- describe('violations', function() {
- it('should find none', function() {
+ describe('violations', function () {
+ it('should find none', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes[0].nodes, 1);
});
});
diff --git a/test/integration/full/aria-hidden-focus/modal.html b/test/integration/full/aria-hidden-focus/modal.html
index c40964a62a..144ca98b7b 100644
--- a/test/integration/full/aria-hidden-focus/modal.html
+++ b/test/integration/full/aria-hidden-focus/modal.html
@@ -50,9 +50,7 @@
Click me
-
- Subscribe to our newsletter!
-
+
Subscribe to our newsletter!
diff --git a/test/integration/full/aria-hidden-focus/modal.js b/test/integration/full/aria-hidden-focus/modal.js
index e3715e2c61..dc981942df 100644
--- a/test/integration/full/aria-hidden-focus/modal.js
+++ b/test/integration/full/aria-hidden-focus/modal.js
@@ -1,11 +1,11 @@
-describe('aria-hidden-focus test', function() {
+describe('aria-hidden-focus test', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{ runOnly: { type: 'rule', values: ['aria-hidden-focus'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -14,24 +14,24 @@ describe('aria-hidden-focus test', function() {
});
});
- describe('violations', function() {
- it('should find 0 violations', function() {
+ describe('violations', function () {
+ it('should find 0 violations', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('passes', function() {
- it('should find 0 passes', function() {
+ describe('passes', function () {
+ it('should find 0 passes', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('incomplete', function() {
- it('should find 1', function() {
+ describe('incomplete', function () {
+ it('should find 1', function () {
assert.lengthOf(results.incomplete[0].nodes, 1);
});
- it('should find #incomplete1', function() {
+ it('should find #incomplete1', function () {
assert.deepEqual(results.incomplete[0].nodes[0].target, ['#incomplete1']);
});
});
diff --git a/test/integration/full/async/async.js b/test/integration/full/async/async.js
index 9a96513edf..6992adfe52 100644
--- a/test/integration/full/async/async.js
+++ b/test/integration/full/async/async.js
@@ -1,4 +1,4 @@
-describe('async rule test', function() {
+describe('async rule test', function () {
'use strict';
var results;
@@ -6,7 +6,7 @@ describe('async rule test', function() {
/*eslint indent: 0*/
var check = this;
var done = check.async();
- setTimeout(function() {
+ setTimeout(function () {
var dataOut = node.getAttribute('data-out');
check.data(dataOut);
switch (dataOut) {
@@ -22,7 +22,7 @@ describe('async rule test', function() {
}, 10);
}
- before(function(done) {
+ before(function (done) {
axe.configure({
rules: [
{
@@ -57,23 +57,23 @@ describe('async rule test', function() {
]
});
- axe.run({ runOnly: { type: 'rule', values: ['my-async'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ axe.run(
+ { runOnly: { type: 'rule', values: ['my-async'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
- describe('violations', function() {
- it('should find 1', function() {
+ describe('violations', function () {
+ it('should find 1', function () {
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.violations[0].nodes, 1);
});
- it('should find #violation', function() {
+ it('should find #violation', function () {
assert.equal(
results.violations[0].nodes[0].any[0].message,
'failed with false'
@@ -82,13 +82,13 @@ describe('async rule test', function() {
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.passes[0].nodes, 1);
});
- it('should find #pass', function() {
+ it('should find #pass', function () {
assert.equal(
results.passes[0].nodes[0].any[0].message,
'passed with true'
@@ -97,13 +97,13 @@ describe('async rule test', function() {
});
});
- describe('incomplete', function() {
- it('should find 1', function() {
+ describe('incomplete', function () {
+ it('should find 1', function () {
assert.lengthOf(results.incomplete, 1);
assert.lengthOf(results.incomplete[0].nodes, 1);
});
- it('should find #incomplete', function() {
+ it('should find #incomplete', function () {
assert.equal(
results.incomplete[0].nodes[0].any[0].message,
'incomplete with undefined'
diff --git a/test/integration/full/bypass/fail.js b/test/integration/full/bypass/fail.js
index 3f7c1721af..8e12994917 100644
--- a/test/integration/full/bypass/fail.js
+++ b/test/integration/full/bypass/fail.js
@@ -1,36 +1,36 @@
-describe('bypass fail test', function() {
+describe('bypass fail test', function () {
'use strict';
var results;
- before(function(done) {
+ before(function (done) {
var mocha = document.getElementById('mocha'),
html = mocha.innerHTML;
mocha.innerHTML = '';
- axe.testUtils.awaitNestedLoad(function() {
- axe.run({ runOnly: { type: 'rule', values: ['bypass'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
+ axe.testUtils.awaitNestedLoad(function () {
+ axe.run(
+ { runOnly: { type: 'rule', values: ['bypass'] } },
+ function (err, r) {
+ assert.isNull(err);
- results = r;
- mocha.innerHTML = html;
- done();
- });
+ results = r;
+ mocha.innerHTML = html;
+ done();
+ }
+ );
});
});
- describe('incomplete', function() {
- it('should find 1', function() {
+ describe('incomplete', function () {
+ it('should find 1', function () {
assert.lengthOf(results.incomplete, 1);
});
- it('should find html', function() {
+ it('should find html', function () {
assert.deepEqual(results.incomplete[0].nodes[0].target, ['html']);
});
});
- describe('passes', function() {
- it('should find none', function() {
+ describe('passes', function () {
+ it('should find none', function () {
assert.lengthOf(results.passes, 0);
});
});
diff --git a/test/integration/full/bypass/header-iframe-fail.js b/test/integration/full/bypass/header-iframe-fail.js
index d54d244808..eed2f05509 100644
--- a/test/integration/full/bypass/header-iframe-fail.js
+++ b/test/integration/full/bypass/header-iframe-fail.js
@@ -1,37 +1,37 @@
-describe('bypass iframe test fail', function() {
+describe('bypass iframe test fail', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
// Stop messing with my tests Mocha!
var heading = document.querySelector('#mocha h1');
if (heading) {
heading.outerHTML = '
bypass iframe test fail
';
}
- axe.run({ runOnly: { type: 'rule', values: ['bypass'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ axe.run(
+ { runOnly: { type: 'rule', values: ['bypass'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
});
- describe('incomplete', function() {
- it('should find 1', function() {
+ describe('incomplete', function () {
+ it('should find 1', function () {
assert.lengthOf(results.incomplete[0].nodes, 1);
});
- it('should find #frame1', function() {
+ it('should find #frame1', function () {
assert.deepEqual(results.incomplete[0].nodes[0].target, ['#fail1']);
});
});
- describe('passes', function() {
- it('should find none', function() {
+ describe('passes', function () {
+ it('should find none', function () {
assert.lengthOf(results.passes, 0);
});
});
diff --git a/test/integration/full/bypass/header-iframe-pass.js b/test/integration/full/bypass/header-iframe-pass.js
index d94699c989..0db2ebd9b0 100644
--- a/test/integration/full/bypass/header-iframe-pass.js
+++ b/test/integration/full/bypass/header-iframe-pass.js
@@ -1,38 +1,38 @@
-describe('bypass iframe test pass', function() {
+describe('bypass iframe test pass', function () {
'use strict';
var results;
- before(function(done) {
+ before(function (done) {
this.timeout = 50000;
- axe.testUtils.awaitNestedLoad(function() {
+ axe.testUtils.awaitNestedLoad(function () {
// Stop messing with my tests Mocha!
var heading = document.querySelector('#mocha h1');
if (heading) {
heading.outerHTML = '
bypass pass test fail
';
}
- axe.run({ runOnly: { type: 'rule', values: ['bypass'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ axe.run(
+ { runOnly: { type: 'rule', values: ['bypass'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
});
- describe('incomplete', function() {
- it('should find none', function() {
+ describe('incomplete', function () {
+ it('should find none', function () {
assert.lengthOf(results.incomplete, 0);
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes[0].nodes, 1);
});
- it('should find #pass1', function() {
+ it('should find #pass1', function () {
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass1']);
});
});
diff --git a/test/integration/full/bypass/pass-tests.js b/test/integration/full/bypass/pass-tests.js
index 9a40194a32..7b56d6a4d9 100644
--- a/test/integration/full/bypass/pass-tests.js
+++ b/test/integration/full/bypass/pass-tests.js
@@ -1,31 +1,31 @@
-describe('bypass aria header test ' + window.location.pathname, function() {
+describe('bypass aria header test ' + window.location.pathname, function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
- axe.run({ runOnly: { type: 'rule', values: ['bypass'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
+ axe.run(
+ { runOnly: { type: 'rule', values: ['bypass'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
});
- describe('incomplete', function() {
- it('should find none', function() {
+ describe('incomplete', function () {
+ it('should find none', function () {
assert.lengthOf(results.incomplete, 0);
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes[0].nodes, 1);
});
- it('should find html', function() {
+ it('should find html', function () {
assert.deepEqual(results.passes[0].nodes[0].target, ['html']);
});
});
diff --git a/test/integration/full/configure-options/configure-options.js b/test/integration/full/configure-options/configure-options.js
index 707ee1f404..b90456c75c 100644
--- a/test/integration/full/configure-options/configure-options.js
+++ b/test/integration/full/configure-options/configure-options.js
@@ -1,16 +1,16 @@
-describe('Configure Options', function() {
+describe('Configure Options', function () {
'use strict';
var target = document.querySelector('#target');
- afterEach(function() {
+ afterEach(function () {
axe.reset();
target.innerHTML = '';
});
- describe('Check', function() {
- describe('aria-allowed-attr', function() {
- it('should allow an attribute supplied in options', function(done) {
+ describe('Check', function () {
+ describe('aria-allowed-attr', function () {
+ it('should allow an attribute supplied in options', function (done) {
target.setAttribute('role', 'separator');
target.setAttribute('aria-valuenow', '0');
@@ -30,14 +30,14 @@ describe('Configure Options', function() {
values: ['aria-allowed-attr']
}
},
- function(error, results) {
+ function (error, results) {
assert.lengthOf(results.violations, 0, 'violations');
done();
}
);
});
- it('should not normalize external check options', function(done) {
+ it('should not normalize external check options', function (done) {
target.setAttribute('lang', 'en');
axe.configure({
@@ -87,7 +87,7 @@ describe('Configure Options', function() {
values: ['dylang']
}
},
- function(err, results) {
+ function (err, results) {
try {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
@@ -100,8 +100,8 @@ describe('Configure Options', function() {
});
});
- describe('aria-required-attr', function() {
- it('should report unique attributes when supplied from options', function(done) {
+ describe('aria-required-attr', function () {
+ it('should report unique attributes when supplied from options', function (done) {
target.setAttribute('role', 'slider');
axe.configure({
checks: [
@@ -119,7 +119,7 @@ describe('Configure Options', function() {
values: ['aria-required-attr']
}
},
- function(error, results) {
+ function (error, results) {
assert.lengthOf(results.violations, 1, 'violations');
assert.sameMembers(results.violations[0].nodes[0].any[0].data, [
'aria-snuggles'
@@ -131,8 +131,8 @@ describe('Configure Options', function() {
});
});
- describe('disableOtherRules', function() {
- it('disables rules that are not in the `rules` array', function(done) {
+ describe('disableOtherRules', function () {
+ it('disables rules that are not in the `rules` array', function (done) {
axe.configure({
disableOtherRules: true,
rules: [
@@ -147,7 +147,7 @@ describe('Configure Options', function() {
]
});
- axe.run(function(error, results) {
+ axe.run(function (error, results) {
assert.isNull(error);
assert.lengthOf(results.passes, 1, 'passes');
assert.equal(results.passes[0].id, 'html-has-lang');
@@ -160,9 +160,9 @@ describe('Configure Options', function() {
});
});
- describe('noHtml', function() {
+ describe('noHtml', function () {
var captureError = axe.testUtils.captureError;
- it('prevents html property on nodes', function(done) {
+ it('prevents html property on nodes', function (done) {
target.setAttribute('role', 'slider');
axe.configure({
noHtml: true,
@@ -181,7 +181,7 @@ describe('Configure Options', function() {
values: ['aria-required-attr']
}
},
- captureError(function(error, results) {
+ captureError(function (error, results) {
assert.isNull(error);
assert.isNull(results.violations[0].nodes[0].html);
done();
@@ -189,7 +189,7 @@ describe('Configure Options', function() {
);
});
- it('prevents html property on nodes from iframes', function(done) {
+ it('prevents html property on nodes from iframes', function (done) {
var config = {
noHtml: true,
rules: [
@@ -204,7 +204,7 @@ describe('Configure Options', function() {
var iframe = document.createElement('iframe');
iframe.src = '/test/mock/frames/context.html';
- iframe.onload = function() {
+ iframe.onload = function () {
axe.configure(config);
axe.run(
@@ -215,7 +215,7 @@ describe('Configure Options', function() {
values: ['div#target']
}
},
- captureError(function(error, results) {
+ captureError(function (error, results) {
assert.isNull(error);
assert.deepEqual(results.passes[0].nodes[0].target, [
'iframe',
@@ -229,7 +229,7 @@ describe('Configure Options', function() {
target.appendChild(iframe);
});
- it('prevents html property in postMesage', function(done) {
+ it('prevents html property in postMesage', function (done) {
var config = {
noHtml: true,
rules: [
@@ -244,7 +244,7 @@ describe('Configure Options', function() {
var iframe = document.createElement('iframe');
iframe.src = '/test/mock/frames/noHtml-config.html';
- iframe.onload = function() {
+ iframe.onload = function () {
axe.configure(config);
axe.run('#target', {
@@ -256,7 +256,7 @@ describe('Configure Options', function() {
};
target.appendChild(iframe);
- window.addEventListener('message', function(e) {
+ window.addEventListener('message', function (e) {
var data = JSON.parse(e.data);
if (Array.isArray(data.payload)) {
try {
diff --git a/test/integration/full/context/context.html b/test/integration/full/context/context.html
index 55a3e3456b..62f5fd522d 100644
--- a/test/integration/full/context/context.html
+++ b/test/integration/full/context/context.html
@@ -23,7 +23,7 @@
-
+
diff --git a/test/integration/full/context/context.js b/test/integration/full/context/context.js
index 6ed2b6ae87..09599daa86 100644
--- a/test/integration/full/context/context.js
+++ b/test/integration/full/context/context.js
@@ -1,18 +1,18 @@
-describe('context test', function() {
+describe('context test', function () {
'use strict';
var config = { runOnly: { type: 'rule', values: ['html-lang-valid'] } };
var shadowSupported = axe.testUtils.shadowSupport.v1;
- before(function(done) {
+ before(function (done) {
axe.testUtils.awaitNestedLoad(done);
axe._tree = undefined;
});
- describe('direct exclude', function() {
- describe('no include', function() {
- it('should find no violations given a selector array', function(done) {
- axe.run({ exclude: [['iframe']] }, config, function(err, results) {
+ describe('direct exclude', function () {
+ describe('no include', function () {
+ it('should find no violations given a selector array', function (done) {
+ axe.run({ exclude: [['iframe']] }, config, function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
@@ -25,33 +25,34 @@ describe('context test', function() {
});
});
- it('should find one violation given a multi-level selector array', function(done) {
- axe.run({ exclude: [['iframe', 'iframe']] }, config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1, 'violations');
- assert.lengthOf(
- results.violations[0].nodes,
- 1,
- 'level1.html; 2-a & 2-b excluded'
- );
- assert.lengthOf(results.passes, 1, 'passes');
- assert.lengthOf(
- results.passes[0].nodes,
- 1,
- 'context.html (main doc) not excluded'
- );
- done();
- });
+ it('should find one violation given a multi-level selector array', function (done) {
+ axe.run(
+ { exclude: [['iframe', 'iframe']] },
+ config,
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1, 'violations');
+ assert.lengthOf(
+ results.violations[0].nodes,
+ 1,
+ 'level1.html; 2-a & 2-b excluded'
+ );
+ assert.lengthOf(results.passes, 1, 'passes');
+ assert.lengthOf(
+ results.passes[0].nodes,
+ 1,
+ 'context.html (main doc) not excluded'
+ );
+ done();
+ }
+ );
});
- it('should find no violations given a direct reference', function(done) {
+ it('should find no violations given a direct reference', function (done) {
axe.run(
{ exclude: [document.querySelector('iframe')] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
@@ -65,11 +66,11 @@ describe('context test', function() {
);
});
- it('should find no violations given a NodeList', function(done) {
+ it('should find no violations given a NodeList', function (done) {
axe.run(
{ exclude: document.getElementsByTagName('iframe') },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
@@ -84,12 +85,12 @@ describe('context test', function() {
});
});
- describe('body include', function() {
- it('should find no violations given a selector array', function(done) {
+ describe('body include', function () {
+ it('should find no violations given a selector array', function (done) {
axe.run(
{ include: [document.body], exclude: [['iframe']] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -98,11 +99,11 @@ describe('context test', function() {
);
});
- it('should find one violation given a multi-level selector array', function(done) {
+ it('should find one violation given a multi-level selector array', function (done) {
axe.run(
{ include: [document.body], exclude: [['iframe', 'iframe']] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -111,14 +112,14 @@ describe('context test', function() {
);
});
- it('should find no violations given a direct reference', function(done) {
+ it('should find no violations given a direct reference', function (done) {
axe.run(
{
include: [document.body],
exclude: [document.querySelector('iframe')]
},
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -127,14 +128,14 @@ describe('context test', function() {
);
});
- it('should find no violations given a NodeList', function(done) {
+ it('should find no violations given a NodeList', function (done) {
axe.run(
{
include: [document.body],
exclude: document.getElementsByTagName('iframe')
},
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -145,12 +146,12 @@ describe('context test', function() {
});
});
- describe('indirect exclude', function() {
- it('should find no nodes', function(done) {
+ describe('indirect exclude', function () {
+ it('should find no nodes', function (done) {
axe.run(
{ include: [document.body], exclude: [['#myframe']] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -159,71 +160,74 @@ describe('context test', function() {
);
});
- (shadowSupported ? it : xit)('should find no nodes in Shadow DOM', function(
- done
- ) {
- var sConfig = { runOnly: { type: 'rule', values: ['color-contrast'] } };
- axe.run(
- { include: [['#shadow-container']], exclude: [['#shadow-host']] },
- sConfig,
- function(err, results) {
- try {
+ (shadowSupported ? it : xit)(
+ 'should find no nodes in Shadow DOM',
+ function (done) {
+ var sConfig = { runOnly: { type: 'rule', values: ['color-contrast'] } };
+ axe.run(
+ { include: [['#shadow-container']], exclude: [['#shadow-host']] },
+ sConfig,
+ function (err, results) {
+ try {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 0, 'violations');
+ assert.lengthOf(results.passes, 1, 'passes');
+ done();
+ } catch (e) {
+ done(e);
+ }
+ }
+ );
+ }
+ );
+
+ describe('no include', function () {
+ it('should find no violations given a selector array', function (done) {
+ axe.run(
+ { exclude: [['#frame-container']] },
+ config,
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
+ assert.lengthOf(
+ results.passes[0].nodes,
+ 1,
+ 'context.html has a lang attribute'
+ );
done();
- } catch (e) {
- done(e);
}
- }
- );
- });
-
- describe('no include', function() {
- it('should find no violations given a selector array', function(done) {
- axe.run({ exclude: [['#frame-container']] }, config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 0, 'violations');
- assert.lengthOf(results.passes, 1, 'passes');
- assert.lengthOf(
- results.passes[0].nodes,
- 1,
- 'context.html has a lang attribute'
- );
- done();
- });
+ );
});
- it('should find one violation given a multi-level selector array', function(done) {
- axe.run({ exclude: [['iframe', 'body']] }, config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1, 'violations');
- assert.lengthOf(
- results.violations[0].nodes,
- 1,
- 'level1.html; 2-a & 2-b excluded'
- );
- assert.lengthOf(results.passes, 1, 'passes');
- assert.lengthOf(
- results.passes[0].nodes,
- 1,
- 'context.html (main doc) not excluded'
- );
- done();
- });
+ it('should find one violation given a multi-level selector array', function (done) {
+ axe.run(
+ { exclude: [['iframe', 'body']] },
+ config,
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1, 'violations');
+ assert.lengthOf(
+ results.violations[0].nodes,
+ 1,
+ 'level1.html; 2-a & 2-b excluded'
+ );
+ assert.lengthOf(results.passes, 1, 'passes');
+ assert.lengthOf(
+ results.passes[0].nodes,
+ 1,
+ 'context.html (main doc) not excluded'
+ );
+ done();
+ }
+ );
});
- it('should find no violations given a direct reference', function(done) {
+ it('should find no violations given a direct reference', function (done) {
axe.run(
{ exclude: [document.querySelector('#frame-container')] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
@@ -237,11 +241,11 @@ describe('context test', function() {
);
});
- it('should find no violations given a NodeList', function(done) {
+ it('should find no violations given a NodeList', function (done) {
axe.run(
{ exclude: document.getElementsByTagName('div') },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 1, 'passes');
@@ -256,12 +260,12 @@ describe('context test', function() {
});
});
- describe('body include', function() {
- it('should find no violations given a selector array', function(done) {
+ describe('body include', function () {
+ it('should find no violations given a selector array', function (done) {
axe.run(
{ include: [document.body], exclude: [['#frame-container']] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -270,11 +274,11 @@ describe('context test', function() {
);
});
- it('should find one violation given a multi-level selector array', function(done) {
+ it('should find one violation given a multi-level selector array', function (done) {
axe.run(
{ include: [document.body], exclude: [['iframe', 'body']] },
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
assert.lengthOf(
@@ -288,14 +292,14 @@ describe('context test', function() {
);
});
- it('should find no violations given a direct reference', function(done) {
+ it('should find no violations given a direct reference', function (done) {
axe.run(
{
include: [document.body],
exclude: [document.querySelector('#frame-container')]
},
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -304,14 +308,14 @@ describe('context test', function() {
);
});
- it('should find no violations given a NodeList', function(done) {
+ it('should find no violations given a NodeList', function (done) {
axe.run(
{
include: [document.body],
exclude: document.getElementsByTagName('div')
},
config,
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0, 'violations');
assert.lengthOf(results.passes, 0, 'passes');
@@ -322,9 +326,9 @@ describe('context test', function() {
});
});
- describe('direct include', function() {
- it('should find the frames given a context object', function(done) {
- axe.run({ include: [['#myframe']] }, config, function(err, results) {
+ describe('direct include', function () {
+ it('should find the frames given a context object', function (done) {
+ axe.run({ include: [['#myframe']] }, config, function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
@@ -332,35 +336,37 @@ describe('context test', function() {
done();
});
});
- it('should find the frames given a direct reference', function(done) {
- axe.run(document.getElementById('myframe'), config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1, 'violations');
- assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
- assert.lengthOf(results.passes, 0, 'passes');
- done();
- });
+ it('should find the frames given a direct reference', function (done) {
+ axe.run(
+ document.getElementById('myframe'),
+ config,
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1, 'violations');
+ assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
+ assert.lengthOf(results.passes, 0, 'passes');
+ done();
+ }
+ );
});
- it('should find the frames given a NodeList', function(done) {
- axe.run(document.getElementsByTagName('iframe'), config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1, 'violations');
- assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
- assert.lengthOf(results.passes, 0, 'passes');
- done();
- });
+ it('should find the frames given a NodeList', function (done) {
+ axe.run(
+ document.getElementsByTagName('iframe'),
+ config,
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1, 'violations');
+ assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
+ assert.lengthOf(results.passes, 0, 'passes');
+ done();
+ }
+ );
});
});
- describe('indirect include', function() {
- it('should find the frames given context object with a node reference', function(done) {
- axe.run({ include: [document.body] }, config, function(err, results) {
+ describe('indirect include', function () {
+ it('should find the frames given context object with a node reference', function (done) {
+ axe.run({ include: [document.body] }, config, function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
@@ -368,8 +374,8 @@ describe('context test', function() {
done();
});
});
- it('should find the frames give a node', function(done) {
- axe.run(document.body, config, function(err, results) {
+ it('should find the frames give a node', function (done) {
+ axe.run(document.body, config, function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 1, 'violations');
assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
@@ -377,17 +383,18 @@ describe('context test', function() {
done();
});
});
- it('should find the frames give a NodeList', function(done) {
- axe.run(document.getElementsByTagName('body'), config, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1, 'violations');
- assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
- assert.lengthOf(results.passes, 0, 'passes');
- done();
- });
+ it('should find the frames give a NodeList', function (done) {
+ axe.run(
+ document.getElementsByTagName('body'),
+ config,
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1, 'violations');
+ assert.lengthOf(results.violations[0].nodes, 3, 'violation nodes');
+ assert.lengthOf(results.passes, 0, 'passes');
+ done();
+ }
+ );
});
});
});
diff --git a/test/integration/full/contrast-enhanced/simple.html b/test/integration/full/contrast-enhanced/simple.html
index a38da200f3..0d7a073a48 100644
--- a/test/integration/full/contrast-enhanced/simple.html
+++ b/test/integration/full/contrast-enhanced/simple.html
@@ -23,21 +23,71 @@
-
Pass (Regular size text, 21:1)
-
Fail (Regular size text, 6:1)
-
Fail (Regular size text, 6.9:1)
-
Pass (Regular size text, 7:1)
-
-
Fail (Large text, 4.487:1)
-
Pass (Large text, 4.5:1)
-
Fail (Large text, but not quite large enough, 4.5:1)
-
-
Fail (Bold text, 4.487:1)
-
Pass (Bold text, 4.5:1)
-
Fail (Bold text, but not quite large enough, 4.5:1)
-
Fail (Bold text, but not quite bold enough, 4.5:1)
+
+ Pass (Regular size text, 21:1)
+
+
+ Fail (Regular size text, 6:1)
+
+
+ Fail (Regular size text, 6.9:1)
+
+
+ Pass (Regular size text, 7:1)
+
+
+
+ Fail (Large text, 4.487:1)
+
+
+ Pass (Large text, 4.5:1)
+
+
+ Fail (Large text, but not quite large enough, 4.5:1)
+
+
+
+ Fail (Bold text, 4.487:1)
+
+
+ Pass (Bold text, 4.5:1)
+
+
+ Fail (Bold text, but not quite large enough, 4.5:1)
+
+
+ Fail (Bold text, but not quite bold enough, 4.5:1)
+
-
+
diff --git a/test/integration/full/contrast-enhanced/simple.js b/test/integration/full/contrast-enhanced/simple.js
index 471f35158f..4b60cfd9f6 100644
--- a/test/integration/full/contrast-enhanced/simple.js
+++ b/test/integration/full/contrast-enhanced/simple.js
@@ -1,30 +1,50 @@
-describe('color-contrast shadow dom test', function() {
+describe('color-contrast shadow dom test', function () {
'use strict';
- describe('violations', function() {
- it('should find issues in simple tree', function(done) {
+ describe('violations', function () {
+ it('should find issues in simple tree', function (done) {
axe.run(
'#fixture',
{ runOnly: { type: 'rule', values: ['color-contrast-enhanced'] } },
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.passes[0].nodes, 4);
assert.lengthOf(results.incomplete, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.violations[0].nodes, 7);
- assert.equal(results.violations[0].nodes[0].any[0].data.fgColor, '#556666');
- assert.equal(results.violations[0].nodes[1].any[0].data.fgColor, '#556000');
- assert.equal(results.violations[0].nodes[2].any[0].data.fgColor, '#118488');
- assert.equal(results.violations[0].nodes[3].any[0].data.fgColor, '#048488');
- assert.equal(results.violations[0].nodes[4].any[0].data.fgColor, '#118488');
- assert.equal(results.violations[0].nodes[5].any[0].data.fgColor, '#048488');
- assert.equal(results.violations[0].nodes[6].any[0].data.fgColor, '#048488');
+ assert.equal(
+ results.violations[0].nodes[0].any[0].data.fgColor,
+ '#556666'
+ );
+ assert.equal(
+ results.violations[0].nodes[1].any[0].data.fgColor,
+ '#556000'
+ );
+ assert.equal(
+ results.violations[0].nodes[2].any[0].data.fgColor,
+ '#118488'
+ );
+ assert.equal(
+ results.violations[0].nodes[3].any[0].data.fgColor,
+ '#048488'
+ );
+ assert.equal(
+ results.violations[0].nodes[4].any[0].data.fgColor,
+ '#118488'
+ );
+ assert.equal(
+ results.violations[0].nodes[5].any[0].data.fgColor,
+ '#048488'
+ );
+ assert.equal(
+ results.violations[0].nodes[6].any[0].data.fgColor,
+ '#048488'
+ );
assert.lengthOf(results.incomplete, 0);
done();
}
);
});
});
-
});
diff --git a/test/integration/full/contrast/blending.html b/test/integration/full/contrast/blending.html
index 1af0520c50..46607098c0 100644
--- a/test/integration/full/contrast/blending.html
+++ b/test/integration/full/contrast/blending.html
@@ -62,11 +62,11 @@
normal
-
-
+
+
Test1
@@ -76,10 +76,10 @@
normal
-
+
Test2
@@ -88,10 +88,10 @@
normal
-
+
Test3
@@ -100,11 +100,11 @@
normal
-
-
+
+
Test4
@@ -114,10 +114,10 @@
normal
-
+
Test5
@@ -126,10 +126,10 @@
normal
-
+
Test6
@@ -138,12 +138,12 @@
normal
-
-
-
+
+
+
Test7
@@ -154,14 +154,14 @@
normal
-
-
-
-
-
+
+
+
+
+
Test8
@@ -174,10 +174,10 @@
normal
-
+
Test9
diff --git a/test/integration/full/contrast/code-highlighting.js b/test/integration/full/contrast/code-highlighting.js
index 15cc121e85..e65839fa95 100644
--- a/test/integration/full/contrast/code-highlighting.js
+++ b/test/integration/full/contrast/code-highlighting.js
@@ -1,4 +1,4 @@
-describe('color-contrast code highlighting test', function() {
+describe('color-contrast code highlighting test', function () {
'use strict';
var results;
@@ -6,7 +6,7 @@ describe('color-contrast code highlighting test', function() {
axe.run(
'#fixture',
{ runOnly: { type: 'rule', values: ['color-contrast'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -14,35 +14,35 @@ describe('color-contrast code highlighting test', function() {
);
}
- before(function(done) {
+ before(function (done) {
// wait for window load event (or if the window has already loaded) so the
// prism styles have loaded before running the tests (in Chrome the load
// even was already fired before Mocha starts the test suite)
if (document.readyState === 'complete') {
run(done);
} else {
- window.addEventListener('load', function() {
+ window.addEventListener('load', function () {
run(done);
});
}
});
- describe('violations', function() {
- it('should find issues', function() {
+ describe('violations', function () {
+ it('should find issues', function () {
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.violations[0].nodes, 32);
});
});
- describe('passes', function() {
- it('should find passes', function() {
+ describe('passes', function () {
+ it('should find passes', function () {
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.passes[0].nodes, 27);
});
});
- describe('incomplete', function() {
- it('should find just the code block', function() {
+ describe('incomplete', function () {
+ it('should find just the code block', function () {
assert.lengthOf(results.incomplete, 1);
assert.lengthOf(results.incomplete[0].nodes, 1);
assert.equal(
diff --git a/test/integration/full/contrast/prism-okaidia.min.css b/test/integration/full/contrast/prism-okaidia.min.css
index bd7f4b1f92..fe92b723a4 100644
--- a/test/integration/full/contrast/prism-okaidia.min.css
+++ b/test/integration/full/contrast/prism-okaidia.min.css
@@ -1,2 +1,99 @@
-code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#272822}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
-/*# sourceMappingURL=prism-okaidia.min.css.map */
\ No newline at end of file
+code[class*='language-'],
+pre[class*='language-'] {
+ color: #f8f8f2;
+ background: 0 0;
+ text-shadow: 0 1px rgba(0, 0, 0, 0.3);
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+ font-size: 1em;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ line-height: 1.5;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+pre[class*='language-'] {
+ padding: 1em;
+ margin: 0.5em 0;
+ overflow: auto;
+ border-radius: 0.3em;
+}
+:not(pre) > code[class*='language-'],
+pre[class*='language-'] {
+ background: #272822;
+}
+:not(pre) > code[class*='language-'] {
+ padding: 0.1em;
+ border-radius: 0.3em;
+ white-space: normal;
+}
+.token.cdata,
+.token.comment,
+.token.doctype,
+.token.prolog {
+ color: #708090;
+}
+.token.punctuation {
+ color: #f8f8f2;
+}
+.namespace {
+ opacity: 0.7;
+}
+.token.constant,
+.token.deleted,
+.token.property,
+.token.symbol,
+.token.tag {
+ color: #f92672;
+}
+.token.boolean,
+.token.number {
+ color: #ae81ff;
+}
+.token.attr-name,
+.token.builtin,
+.token.char,
+.token.inserted,
+.token.selector,
+.token.string {
+ color: #a6e22e;
+}
+.language-css .token.string,
+.style .token.string,
+.token.entity,
+.token.operator,
+.token.url,
+.token.variable {
+ color: #f8f8f2;
+}
+.token.atrule,
+.token.attr-value,
+.token.class-name,
+.token.function {
+ color: #e6db74;
+}
+.token.keyword {
+ color: #66d9ef;
+}
+.token.important,
+.token.regex {
+ color: #fd971f;
+}
+.token.bold,
+.token.important {
+ font-weight: 700;
+}
+.token.italic {
+ font-style: italic;
+}
+.token.entity {
+ cursor: help;
+}
+/*# sourceMappingURL=prism-okaidia.min.css.map */
diff --git a/test/integration/full/contrast/prism.min.css b/test/integration/full/contrast/prism.min.css
index 43bcedafe5..f029935c7e 100644
--- a/test/integration/full/contrast/prism.min.css
+++ b/test/integration/full/contrast/prism.min.css
@@ -1,2 +1,117 @@
-code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
-/*# sourceMappingURL=prism.min.css.map */
\ No newline at end of file
+code[class*='language-'],
+pre[class*='language-'] {
+ color: #000;
+ background: 0 0;
+ text-shadow: 0 1px #fff;
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+ font-size: 1em;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ line-height: 1.5;
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+code[class*='language-'] ::-moz-selection,
+code[class*='language-']::-moz-selection,
+pre[class*='language-'] ::-moz-selection,
+pre[class*='language-']::-moz-selection {
+ text-shadow: none;
+ background: #b3d4fc;
+}
+code[class*='language-'] ::selection,
+code[class*='language-']::selection,
+pre[class*='language-'] ::selection,
+pre[class*='language-']::selection {
+ text-shadow: none;
+ background: #b3d4fc;
+}
+@media print {
+ code[class*='language-'],
+ pre[class*='language-'] {
+ text-shadow: none;
+ }
+}
+pre[class*='language-'] {
+ padding: 1em;
+ margin: 0.5em 0;
+ overflow: auto;
+}
+:not(pre) > code[class*='language-'],
+pre[class*='language-'] {
+ background: #f5f2f0;
+}
+:not(pre) > code[class*='language-'] {
+ padding: 0.1em;
+ border-radius: 0.3em;
+ white-space: normal;
+}
+.token.cdata,
+.token.comment,
+.token.doctype,
+.token.prolog {
+ color: #708090;
+}
+.token.punctuation {
+ color: #999;
+}
+.namespace {
+ opacity: 0.7;
+}
+.token.boolean,
+.token.constant,
+.token.deleted,
+.token.number,
+.token.property,
+.token.symbol,
+.token.tag {
+ color: #905;
+}
+.token.attr-name,
+.token.builtin,
+.token.char,
+.token.inserted,
+.token.selector,
+.token.string {
+ color: #690;
+}
+.language-css .token.string,
+.style .token.string,
+.token.entity,
+.token.operator,
+.token.url {
+ color: #9a6e3a;
+ background: hsla(0, 0%, 100%, 0.5);
+}
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+ color: #07a;
+}
+.token.class-name,
+.token.function {
+ color: #dd4a68;
+}
+.token.important,
+.token.regex,
+.token.variable {
+ color: #e90;
+}
+.token.bold,
+.token.important {
+ font-weight: 700;
+}
+.token.italic {
+ font-style: italic;
+}
+.token.entity {
+ cursor: help;
+}
+/*# sourceMappingURL=prism.min.css.map */
diff --git a/test/integration/full/contrast/shadow-dom.html b/test/integration/full/contrast/shadow-dom.html
index efdbf04eae..25c64b5c7a 100644
--- a/test/integration/full/contrast/shadow-dom.html
+++ b/test/integration/full/contrast/shadow-dom.html
@@ -22,8 +22,8 @@
-
Text
-
+
Text
+
diff --git a/test/integration/full/contrast/shadow-dom.js b/test/integration/full/contrast/shadow-dom.js
index c4ecb67758..9e020a1d23 100644
--- a/test/integration/full/contrast/shadow-dom.js
+++ b/test/integration/full/contrast/shadow-dom.js
@@ -1,9 +1,9 @@
-describe('color-contrast shadow dom test', function() {
+describe('color-contrast shadow dom test', function () {
'use strict';
var shadowSupported = axe.testUtils.shadowSupport.v1;
- before(function() {
+ before(function () {
var fixture = document.querySelector('#fixture');
if (shadowSupported) {
var shadow = fixture.attachShadow({ mode: 'open' });
@@ -17,25 +17,26 @@ describe('color-contrast shadow dom test', function() {
}
});
- describe('violations', function() {
- (shadowSupported ? it : xit)('should find issues in shadow tree', function(
- done
- ) {
- axe.run(
- '#fixture',
- { runOnly: { type: 'rule', values: ['color-contrast'] } },
- function(err, results) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 1);
- assert.lengthOf(results.violations[0].nodes, 2);
- assert.equal(
- results.violations[0].nodes[1].any[0].data.bgColor,
- '#000000'
- );
- assert.lengthOf(results.incomplete, 0);
- done();
- }
- );
- });
+ describe('violations', function () {
+ (shadowSupported ? it : xit)(
+ 'should find issues in shadow tree',
+ function (done) {
+ axe.run(
+ '#fixture',
+ { runOnly: { type: 'rule', values: ['color-contrast'] } },
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 1);
+ assert.lengthOf(results.violations[0].nodes, 2);
+ assert.equal(
+ results.violations[0].nodes[1].any[0].data.bgColor,
+ '#000000'
+ );
+ assert.lengthOf(results.incomplete, 0);
+ done();
+ }
+ );
+ }
+ );
});
});
diff --git a/test/integration/full/contrast/sticky-header.html b/test/integration/full/contrast/sticky-header.html
index a457d79512..8a6aa4d82e 100644
--- a/test/integration/full/contrast/sticky-header.html
+++ b/test/integration/full/contrast/sticky-header.html
@@ -98,9 +98,7 @@
Hi
Some content
Some content
-
+
diff --git a/test/integration/full/contrast/sticky-header.js b/test/integration/full/contrast/sticky-header.js
index 9474cd60b4..1efb2b2621 100644
--- a/test/integration/full/contrast/sticky-header.js
+++ b/test/integration/full/contrast/sticky-header.js
@@ -1,12 +1,12 @@
-describe('color-contrast sticky header test', function() {
+describe('color-contrast sticky header test', function () {
'use strict';
- describe('violations', function() {
- it('should find none', function(done) {
+ describe('violations', function () {
+ it('should find none', function (done) {
axe.run(
'#fixture',
{ runOnly: { type: 'rule', values: ['color-contrast'] } },
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0);
done();
diff --git a/test/integration/full/css-orientation-lock/incomplete.js b/test/integration/full/css-orientation-lock/incomplete.js
index 9d0018ff5c..9731eecba1 100644
--- a/test/integration/full/css-orientation-lock/incomplete.js
+++ b/test/integration/full/css-orientation-lock/incomplete.js
@@ -1,7 +1,7 @@
-describe('css-orientation-lock incomplete test', function() {
+describe('css-orientation-lock incomplete test', function () {
'use strict';
- it('returns INCOMPLETE if preload is set to FALSE', function(done) {
+ it('returns INCOMPLETE if preload is set to FALSE', function (done) {
axe.run(
{
runOnly: {
@@ -10,7 +10,7 @@ describe('css-orientation-lock incomplete test', function() {
},
preload: false
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
@@ -21,7 +21,7 @@ describe('css-orientation-lock incomplete test', function() {
);
});
- it('returns INCOMPLETE as page has no styles (not even mocha styles)', function(done) {
+ it('returns INCOMPLETE as page has no styles (not even mocha styles)', function (done) {
axe.run(
{
runOnly: {
@@ -29,7 +29,7 @@ describe('css-orientation-lock incomplete test', function() {
values: ['css-orientation-lock']
}
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
diff --git a/test/integration/full/css-orientation-lock/passes.js b/test/integration/full/css-orientation-lock/passes.js
index 72586b02af..7d95a56daa 100644
--- a/test/integration/full/css-orientation-lock/passes.js
+++ b/test/integration/full/css-orientation-lock/passes.js
@@ -1,31 +1,29 @@
-describe('css-orientation-lock passes test', function() {
+describe('css-orientation-lock passes test', function () {
'use strict';
var shadowSupported = axe.testUtils.shadowSupport.v1;
var styleSheets = [
{
- href:
- 'https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'
+ href: 'https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'
},
{
- text:
- '@media screen and (min-width: 10px) and (max-width: 3000px) { html { width: 100vh; } }'
+ text: '@media screen and (min-width: 10px) and (max-width: 3000px) { html { width: 100vh; } }'
}
];
- before(function(done) {
+ before(function (done) {
axe.testUtils
.addStyleSheets(styleSheets)
- .then(function() {
+ .then(function () {
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(new Error('Could not load stylesheets for testing. ' + error));
});
});
- it('returns PASSES when page has STYLE with MEDIA rules (not orientation)', function(done) {
+ it('returns PASSES when page has STYLE with MEDIA rules (not orientation)', function (done) {
// the sheets included in the html, have styles for transform and rotate, hence the violation
axe.run(
{
@@ -34,7 +32,7 @@ describe('css-orientation-lock passes test', function() {
values: ['css-orientation-lock']
}
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
@@ -51,7 +49,7 @@ describe('css-orientation-lock passes test', function() {
(shadowSupported ? it : xit)(
'returns PASSES whilst also accommodating shadowDOM styles with MEDIA rules (not orientation)',
- function(done) {
+ function (done) {
// here although media styles are pumped into shadow dom
// they are not orientation locks, so returns as passes
var fixture = document.getElementById('shadow-fixture');
@@ -68,7 +66,7 @@ describe('css-orientation-lock passes test', function() {
values: ['css-orientation-lock']
}
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
diff --git a/test/integration/full/css-orientation-lock/violations.css b/test/integration/full/css-orientation-lock/violations.css
index 48556c6147..e5702b6deb 100644
--- a/test/integration/full/css-orientation-lock/violations.css
+++ b/test/integration/full/css-orientation-lock/violations.css
@@ -1,14 +1,14 @@
@media screen and (min-width: 20px) and (max-width: 2300px) and (orientation: portrait) {
- .thatDiv {
- transform: rotate(90deg);
- }
+ .thatDiv {
+ transform: rotate(90deg);
+ }
}
@media screen and (min-width: 10px) and (max-width: 3000px) and (orientation: landscape) {
- html {
- transform: rotateZ(0, 0, 1, 1.5708rad);
- }
- .someDiv {
- transform: matrix3d(0,-1,0.00,0,1.00,0,0.00,0,0,0,1,0,0,0,0,1);
- }
+ html {
+ transform: rotateZ(0, 0, 1, 1.5708rad);
+ }
+ .someDiv {
+ transform: matrix3d(0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+ }
}
diff --git a/test/integration/full/css-orientation-lock/violations.js b/test/integration/full/css-orientation-lock/violations.js
index 962f694ab1..d32c84c335 100644
--- a/test/integration/full/css-orientation-lock/violations.js
+++ b/test/integration/full/css-orientation-lock/violations.js
@@ -1,38 +1,37 @@
-describe('css-orientation-lock violations test', function() {
+describe('css-orientation-lock violations test', function () {
'use strict';
var shadowSupported = axe.testUtils.shadowSupport.v1;
var styleSheets = [
{
- href:
- 'https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'
+ href: 'https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'
},
{
href: 'violations.css'
}
];
- before(function(done) {
+ before(function (done) {
axe.testUtils
.addStyleSheets(styleSheets)
- .then(function() {
+ .then(function () {
done();
})
- .catch(function(error) {
+ .catch(function (error) {
done(new Error('Could not load stylesheets for testing. ' + error));
});
});
function assertViolatedSelectors(relatedNodes, violatedSelectors) {
- relatedNodes.forEach(function(node) {
+ relatedNodes.forEach(function (node) {
var target = node.target[0];
var className = Array.isArray(target) ? target.reverse()[0] : target;
assert.isTrue(violatedSelectors.indexOf(className) !== -1);
});
}
- it('returns VIOLATIONS if preload is set to TRUE', function(done) {
+ it('returns VIOLATIONS if preload is set to TRUE', function (done) {
// the sheets included in the html, have styles for transform and rotate, hence the violation
axe.run(
{
@@ -41,7 +40,7 @@ describe('css-orientation-lock violations test', function() {
values: ['css-orientation-lock']
}
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
@@ -68,7 +67,7 @@ describe('css-orientation-lock violations test', function() {
(shadowSupported ? it : xit)(
'returns VIOLATIONS whilst also accommodating shadowDOM styles',
- function(done) {
+ function (done) {
var fixture = document.getElementById('shadow-fixture');
var shadow = fixture.attachShadow({ mode: 'open' });
shadow.innerHTML =
@@ -83,7 +82,7 @@ describe('css-orientation-lock violations test', function() {
values: ['css-orientation-lock']
}
},
- function(err, res) {
+ function (err, res) {
assert.isNull(err);
assert.isDefined(res);
diff --git a/test/integration/full/definition-list/dl-role.js b/test/integration/full/definition-list/dl-role.js
index 5c5a97479f..85227c16b8 100644
--- a/test/integration/full/definition-list/dl-role.js
+++ b/test/integration/full/definition-list/dl-role.js
@@ -1,9 +1,9 @@
-describe('definition-list overriden with ARIA role', function() {
+describe('definition-list overriden with ARIA role', function () {
'use strict';
- it('should find no matches', function(done) {
+ it('should find no matches', function (done) {
axe.run(
{ runOnly: { type: 'rule', values: ['definition-list'] } },
- function(err, results) {
+ function (err, results) {
assert.isNull(err);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.passes, 0);
diff --git a/test/integration/full/definition-list/dlitem-role.html b/test/integration/full/definition-list/dlitem-role.html
index 00caae3d53..6ad1456f88 100644
--- a/test/integration/full/definition-list/dlitem-role.html
+++ b/test/integration/full/definition-list/dlitem-role.html
@@ -25,9 +25,7 @@
Stuff
-
- Thing
-
+
Thing
diff --git a/test/integration/full/definition-list/dlitem-role.js b/test/integration/full/definition-list/dlitem-role.js
index 89b452c425..eb02489d50 100644
--- a/test/integration/full/definition-list/dlitem-role.js
+++ b/test/integration/full/definition-list/dlitem-role.js
@@ -1,14 +1,14 @@
-describe('dlitem overriden with ARIA role', function() {
+describe('dlitem overriden with ARIA role', function () {
'use strict';
- it('should find no matches', function(done) {
- axe.run({ runOnly: { type: 'rule', values: ['dlitem'] } }, function(
- err,
- results
- ) {
- assert.isNull(err);
- assert.lengthOf(results.violations, 0);
- assert.lengthOf(results.passes, 0);
- done();
- });
+ it('should find no matches', function (done) {
+ axe.run(
+ { runOnly: { type: 'rule', values: ['dlitem'] } },
+ function (err, results) {
+ assert.isNull(err);
+ assert.lengthOf(results.violations, 0);
+ assert.lengthOf(results.passes, 0);
+ done();
+ }
+ );
});
});
diff --git a/test/integration/full/document-title/document-title-fail.js b/test/integration/full/document-title/document-title-fail.js
index 02d38eb316..b3a52767f9 100644
--- a/test/integration/full/document-title/document-title-fail.js
+++ b/test/integration/full/document-title/document-title-fail.js
@@ -1,12 +1,12 @@
-describe('document-title test failure', function() {
+describe('document-title test failure', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{ runOnly: { type: 'rule', values: ['document-title'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -15,26 +15,26 @@ describe('document-title test failure', function() {
});
});
- describe('violations', function() {
- it('should find 1', function() {
+ describe('violations', function () {
+ it('should find 1', function () {
assert.lengthOf(results.violations[0].nodes, 1);
});
- it('should find first level iframe', function() {
+ it('should find first level iframe', function () {
assert.deepEqual(results.violations[0].nodes[0].target, ['#fail1']);
});
});
- describe('passes', function() {
- it('should find 0', function() {
+ describe('passes', function () {
+ it('should find 0', function () {
assert.lengthOf(results.passes, 0);
});
});
- it('should find 0 inapplicable', function() {
+ it('should find 0 inapplicable', function () {
assert.lengthOf(results.inapplicable, 0);
});
- it('should find 0 incomplete', function() {
+ it('should find 0 incomplete', function () {
assert.lengthOf(results.incomplete, 0);
});
});
diff --git a/test/integration/full/document-title/document-title-pass.js b/test/integration/full/document-title/document-title-pass.js
index fbbc10f445..a150976517 100644
--- a/test/integration/full/document-title/document-title-pass.js
+++ b/test/integration/full/document-title/document-title-pass.js
@@ -1,11 +1,11 @@
-describe('document-title test pass', function() {
+describe('document-title test pass', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{ runOnly: { type: 'rule', values: ['document-title'] } },
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -14,27 +14,27 @@ describe('document-title test pass', function() {
});
});
- describe('violations', function() {
- it('should find 0', function() {
+ describe('violations', function () {
+ it('should find 0', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes[0].nodes, 1);
});
- it('should find #pass1', function() {
+ it('should find #pass1', function () {
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass1']);
});
});
- it('should find 0 inapplicable', function() {
+ it('should find 0 inapplicable', function () {
assert.lengthOf(results.inapplicable, 0);
});
- it('should find 0 incomplete', function() {
+ it('should find 0 incomplete', function () {
assert.lengthOf(results.incomplete, 0);
});
});
diff --git a/test/integration/full/frame-tested/frame-tested-fail.js b/test/integration/full/frame-tested/frame-tested-fail.js
index 970619da62..cf4e9aa01d 100644
--- a/test/integration/full/frame-tested/frame-tested-fail.js
+++ b/test/integration/full/frame-tested/frame-tested-fail.js
@@ -1,9 +1,9 @@
-describe('frame-tested-fail test', function() {
+describe('frame-tested-fail test', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
axe.run(
{
runOnly: { type: 'rule', values: ['frame-tested'] },
@@ -11,7 +11,7 @@ describe('frame-tested-fail test', function() {
'frame-tested': { options: { isViolation: true } }
}
},
- function(err, r) {
+ function (err, r) {
assert.isNull(err);
results = r;
done();
@@ -20,11 +20,11 @@ describe('frame-tested-fail test', function() {
});
});
- describe('violations', function() {
- it('should find 1', function() {
+ describe('violations', function () {
+ it('should find 1', function () {
assert.lengthOf(results.violations[0].nodes, 1);
});
- it('should find the failing iframe', function() {
+ it('should find the failing iframe', function () {
assert.deepEqual(results.violations[0].nodes[0].target, [
'#frame',
'#fail'
@@ -32,14 +32,14 @@ describe('frame-tested-fail test', function() {
});
});
- describe('incomplete', function() {
- it('should find 0', function() {
+ describe('incomplete', function () {
+ it('should find 0', function () {
assert.lengthOf(results.incomplete, 0);
});
});
- describe('passes', function() {
- it('should find 2', function() {
+ describe('passes', function () {
+ it('should find 2', function () {
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.passes[0].nodes, 2);
diff --git a/test/integration/full/frame-tested/frame-tested-incomplete.js b/test/integration/full/frame-tested/frame-tested-incomplete.js
index 6729d4ee33..9e0880af27 100644
--- a/test/integration/full/frame-tested/frame-tested-incomplete.js
+++ b/test/integration/full/frame-tested/frame-tested-incomplete.js
@@ -1,37 +1,37 @@
-describe('frame-tested-incomplete test', function() {
+describe('frame-tested-incomplete test', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
- axe.run({ runOnly: { type: 'rule', values: ['frame-tested'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
+ axe.run(
+ { runOnly: { type: 'rule', values: ['frame-tested'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
});
- describe('incomplete', function() {
- it('should find 1', function() {
+ describe('incomplete', function () {
+ it('should find 1', function () {
assert.lengthOf(results.incomplete[0].nodes, 1);
});
- it('should find first iframe', function() {
+ it('should find first iframe', function () {
assert.deepEqual(results.incomplete[0].nodes[0].target, ['#incomplete']);
});
});
- describe('violations', function() {
- it('should find 0', function() {
+ describe('violations', function () {
+ it('should find 0', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('passes', function() {
- it('should find 0', function() {
+ describe('passes', function () {
+ it('should find 0', function () {
assert.lengthOf(results.passes, 0);
});
});
diff --git a/test/integration/full/frame-tested/frame-tested-pass.js b/test/integration/full/frame-tested/frame-tested-pass.js
index 35bdb5205b..e28c09f1ff 100644
--- a/test/integration/full/frame-tested/frame-tested-pass.js
+++ b/test/integration/full/frame-tested/frame-tested-pass.js
@@ -1,37 +1,37 @@
-describe('frame-tested-pass test', function() {
+describe('frame-tested-pass test', function () {
'use strict';
var results;
- before(function(done) {
- axe.testUtils.awaitNestedLoad(function() {
- axe.run({ runOnly: { type: 'rule', values: ['frame-tested'] } }, function(
- err,
- r
- ) {
- assert.isNull(err);
- results = r;
- done();
- });
+ before(function (done) {
+ axe.testUtils.awaitNestedLoad(function () {
+ axe.run(
+ { runOnly: { type: 'rule', values: ['frame-tested'] } },
+ function (err, r) {
+ assert.isNull(err);
+ results = r;
+ done();
+ }
+ );
});
});
- describe('passes', function() {
- it('should find 1', function() {
+ describe('passes', function () {
+ it('should find 1', function () {
assert.lengthOf(results.passes[0].nodes, 1);
});
- it('should find first iframe', function() {
+ it('should find first iframe', function () {
assert.deepEqual(results.passes[0].nodes[0].target, ['#pass']);
});
});
- describe('violations', function() {
- it('should find 0', function() {
+ describe('violations', function () {
+ it('should find 0', function () {
assert.lengthOf(results.violations, 0);
});
});
- describe('incomplete', function() {
- it('should find 0', function() {
+ describe('incomplete', function () {
+ it('should find 0', function () {
assert.lengthOf(results.incomplete, 0);
});
});
diff --git a/test/integration/full/frame-wait-time/frame-wait-time.js b/test/integration/full/frame-wait-time/frame-wait-time.js
index beea0aab09..c3420674fe 100644
--- a/test/integration/full/frame-wait-time/frame-wait-time.js
+++ b/test/integration/full/frame-wait-time/frame-wait-time.js
@@ -1,23 +1,23 @@
/* global sinon */
// TODO: remove when tests are fixed
-describe('frame-wait-time optin', function() {
- it('works', function() {
+describe('frame-wait-time optin', function () {
+ it('works', function () {
assert.isTrue(true);
});
});
-describe.skip('frame-wait-time option', function() {
+describe.skip('frame-wait-time option', function () {
'use strict';
var spy;
var respondable = axe.utils.respondable;
- before(function(done) {
+ before(function (done) {
// Fix Function#name on browsers that do not support it (IE):
// @see https://stackoverflow.com/a/17056530
if (!function f() {}.name) {
Object.defineProperty(Function.prototype, 'name', {
- get: function() {
+ get: function () {
var name = (this.toString().match(/^function\s*([^\s(]+)/) || [])[1];
// For better performance only parse once, and then cache the
// result through a new accessor for repeated access.
@@ -27,22 +27,22 @@ describe.skip('frame-wait-time option', function() {
});
}
- axe.testUtils.awaitNestedLoad(function() {
+ axe.testUtils.awaitNestedLoad(function () {
done();
});
});
- beforeEach(function() {
+ beforeEach(function () {
// prevent test from running axe inside the iframe multiple times
- axe.utils.respondable = function(a, b, c, d, callback) {
- setTimeout(function() {
+ axe.utils.respondable = function (a, b, c, d, callback) {
+ setTimeout(function () {
callback();
}, 50);
};
spy = sinon.spy(window, 'setTimeout');
});
- afterEach(function() {
+ afterEach(function () {
axe.utils.respondable = respondable;
spy.restore();
});
@@ -61,8 +61,8 @@ describe.skip('frame-wait-time option', function() {
return timeoutCall;
}
- describe('when set', function() {
- it('should modify the default frame timeout', function(done) {
+ describe('when set', function () {
+ it('should modify the default frame timeout', function (done) {
var opts = {
frameWaitTime: 1,
runOnly: {
@@ -70,7 +70,7 @@ describe.skip('frame-wait-time option', function() {
values: ['html-has-lang']
}
};
- axe.run('#frame', opts, function() {
+ axe.run('#frame', opts, function () {
var timeoutCall = getTimeoutCall();
assert.exists(timeoutCall, 'FrameTimeout not called');
assert.equal(timeoutCall.args[1], 1);
@@ -79,9 +79,9 @@ describe.skip('frame-wait-time option', function() {
});
});
- describe('when not set', function() {
- it('should use the default frame timeout', function(done) {
- axe.run('#frame', function() {
+ describe('when not set', function () {
+ it('should use the default frame timeout', function (done) {
+ axe.run('#frame', function () {
var timeoutCall = getTimeoutCall();
assert.exists(timeoutCall, 'FrameTimeout not called');
assert.equal(timeoutCall.args[1], 60000);
diff --git a/test/integration/full/frame-wait-time/frames/frame.html b/test/integration/full/frame-wait-time/frames/frame.html
index 6246f6cf3d..b754a4b387 100644
--- a/test/integration/full/frame-wait-time/frames/frame.html
+++ b/test/integration/full/frame-wait-time/frames/frame.html
@@ -6,6 +6,6 @@
-
So Dim
+
So Dim