'
);
// landmark-is-top-level requires a complete tree to work properly
@@ -21,8 +19,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'main' });
});
- it('should return false if the complementary landmark is in another landmark', function () {
- var params = checkSetup(
+ it('should return false if the complementary landmark is in another landmark', () => {
+ const params = checkSetup(
''
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -30,8 +28,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'complementary' });
});
- it('should return true if the complementary landmark is in main landmark', function () {
- var params = checkSetup(
+ it('should return true if the complementary landmark is in main landmark', () => {
+ const params = checkSetup(
''
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -39,8 +37,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'complementary' });
});
- it('should return false if div with role set to main is in another landmark', function () {
- var params = checkSetup(
+ it('should return false if div with role set to main is in another landmark', () => {
+ const params = checkSetup(
'
'
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -48,8 +46,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'main' });
});
- it('should return true if the landmark is not in another landmark', function () {
- var params = checkSetup(
+ it('should return true if the landmark is not in another landmark', () => {
+ const params = checkSetup(
'
'
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -57,8 +55,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'contentinfo' });
});
- it('should return true if div with role set to main is not in another landmark', function () {
- var params = checkSetup(
+ it('should return true if div with role set to main is not in another landmark', () => {
+ const params = checkSetup(
'
'
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -66,8 +64,8 @@ describe('landmark-is-top-level', function () {
assert.deepEqual(checkContext._data, { role: 'main' });
});
- it('should return true if the banner landmark is not in form landmark', function () {
- var params = checkSetup(
+ it('should return true if the banner landmark is not in form landmark', () => {
+ const params = checkSetup(
'
'
);
axe.utils.getFlattenedTree(document.documentElement);
@@ -77,8 +75,8 @@ describe('landmark-is-top-level', function () {
(shadowSupported ? it : xit)(
'should test if the landmark in shadow DOM is top level',
- function () {
- var params = shadowCheckSetup(
+ () => {
+ const params = shadowCheckSetup(
'',
'Main content'
);
diff --git a/test/checks/tables/th-has-data-cells.js b/test/checks/tables/th-has-data-cells.js
index 37058aea6c..1acc530f3a 100644
--- a/test/checks/tables/th-has-data-cells.js
+++ b/test/checks/tables/th-has-data-cells.js
@@ -1,16 +1,13 @@
-describe('th-has-data-cells', function () {
- 'use strict';
+describe('th-has-data-cells', () => {
+ const fixture = document.getElementById('fixture');
+ const shadowSupport = axe.testUtils.shadowSupport.v1;
+ const checkContext = axe.testUtils.MockCheckContext();
- var fixture = document.getElementById('fixture');
- var shadowSupport = axe.testUtils.shadowSupport.v1;
- var checkContext = axe.testUtils.MockCheckContext();
-
- afterEach(function () {
- fixture.innerHTML = '';
+ afterEach(() => {
checkContext.reset();
});
- it('should return true each row header has a non-empty cell', function () {
+ it('should return true each row header has a non-empty cell', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -42,7 +39,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return true if referred to with headers attr', function () {
+ it('should return true if referred to with headers attr', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -58,7 +55,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return true if referred to with aria-labelledby', function () {
+ it('should return true if referred to with aria-labelledby', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -74,14 +71,14 @@ describe('th-has-data-cells', function () {
);
});
- it('should return true if the th element is empty', function () {
+ it('should return true if the th element is empty', () => {
fixture.innerHTML =
'
' +
'
' +
'
' +
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -89,7 +86,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return true when the td has a content element', function () {
+ it('should return true when the td has a content element', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -110,7 +107,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return undefined if a th has no data cells', function () {
+ it('should return undefined if a th has no data cells', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isUndefined(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -126,7 +123,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return true if all data cells are empty', function () {
+ it('should return true if all data cells are empty', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -142,14 +139,14 @@ describe('th-has-data-cells', function () {
);
});
- it('should return undefined if a td with role=columnheader is used that has no data cells', function () {
+ it('should return undefined if a td with role=columnheader is used that has no data cells', () => {
fixture.innerHTML =
'
' +
'
axe
AXE
' +
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isUndefined(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -157,7 +154,7 @@ describe('th-has-data-cells', function () {
);
});
- it('should return undefined if table cell points to a different header', function () {
+ it('should return undefined if table cell points to a different header', () => {
fixture.innerHTML =
'
';
axe.testUtils.flatTreeSetup(fixture);
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
assert.isUndefined(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
@@ -179,9 +176,9 @@ describe('th-has-data-cells', function () {
);
});
- (shadowSupport ? it : xit)('recognizes shadow tree content', function () {
+ (shadowSupport ? it : xit)('recognizes shadow tree content', () => {
fixture.innerHTML = '
data
';
- var shadow = fixture
+ const shadow = fixture
.querySelector('#shadow')
.attachShadow({ mode: 'open' });
shadow.innerHTML =
@@ -191,7 +188,7 @@ describe('th-has-data-cells', function () {
'';
axe.testUtils.flatTreeSetup(fixture);
- var node = axe.utils.querySelectorAll(axe._tree, 'table')[0].actualNode;
+ const node = axe.utils.querySelectorAll(axe._tree, 'table')[0].actualNode;
assert.isTrue(
axe.testUtils
.getCheckEvaluate('th-has-data-cells')
diff --git a/test/commons/aria/get-explicit-role.js b/test/commons/aria/get-explicit-role.js
index b657248d24..3747218ef8 100644
--- a/test/commons/aria/get-explicit-role.js
+++ b/test/commons/aria/get-explicit-role.js
@@ -1,141 +1,140 @@
-describe('aria.getExplicitRole', function () {
- 'use strict';
- var aria = axe.commons.aria;
- var roleDefinitions = aria.lookupTable.role;
- var flatTreeSetup = axe.testUtils.flatTreeSetup;
-
- it('returns valid roles', function () {
- var node = document.createElement('div');
+describe('aria.getExplicitRole', () => {
+ const aria = axe.commons.aria;
+ const roleDefinitions = aria.lookupTable.role;
+ const flatTreeSetup = axe.testUtils.flatTreeSetup;
+
+ it('returns valid roles', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'button');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode), 'button');
});
- it('handles case sensitivity', function () {
- var node = document.createElement('div');
+ it('handles case sensitivity', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'BUTTON');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode), 'button');
});
- it('handles whitespacing', function () {
- var node = document.createElement('div');
+ it('handles whitespacing', () => {
+ const node = document.createElement('div');
node.setAttribute('role', ' button ');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode), 'button');
});
- it('returns null when there is no role', function () {
- var node = document.createElement('div');
- var vNode = flatTreeSetup(node)[0];
+ it('returns null when there is no role', () => {
+ const node = document.createElement('div');
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode));
});
- it('returns the explicit role if it is valid and non-abstract', function () {
- var node = document.createElement('li');
+ it('returns the explicit role if it is valid and non-abstract', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'menuitem');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode), 'menuitem');
});
- it('ignores fallback roles by default', function () {
- var node = document.createElement('div');
+ it('ignores fallback roles by default', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'spinbutton button');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode));
});
- it('returns null if the node is not an element', function () {
- var node = document.createTextNode('foo bar baz');
- var vNode = flatTreeSetup(node)[0];
+ it('returns null if the node is not an element', () => {
+ const node = document.createTextNode('foo bar baz');
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode));
});
- describe('abstracts', function () {
- it('ignores abstract roles by default', function () {
- var node = document.createElement('li');
+ describe('abstracts', () => {
+ it('ignores abstract roles by default', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'section');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(roleDefinitions.section.type, 'abstract');
assert.isNull(aria.getExplicitRole(vNode));
});
- it('returns abstract roles with `abstracts: true`', function () {
- var node = document.createElement('li');
+ it('returns abstract roles with `abstracts: true`', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'section');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(roleDefinitions.section.type, 'abstract');
assert.equal(aria.getExplicitRole(vNode, { abstracts: true }), 'section');
});
- it('does not returns abstract roles with `abstracts: false`', function () {
- var node = document.createElement('li');
+ it('does not returns abstract roles with `abstracts: false`', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'section');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(roleDefinitions.section.type, 'abstract');
assert.isNull(aria.getExplicitRole(vNode, { abstracts: false }));
});
});
- describe('dpub', function () {
- it('ignores DPUB roles by default', function () {
- var node = document.createElement('section');
+ describe('dpub', () => {
+ it('ignores DPUB roles by default', () => {
+ const node = document.createElement('section');
node.setAttribute('role', 'doc-chapter');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode));
});
- it('returns DPUB roles with `dpub: true`', function () {
- var node = document.createElement('section');
+ it('returns DPUB roles with `dpub: true`', () => {
+ const node = document.createElement('section');
node.setAttribute('role', 'doc-chapter');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode, { dpub: true }), 'doc-chapter');
});
- it('does not returns DPUB roles with `dpub: false`', function () {
- var node = document.createElement('section');
+ it('does not returns DPUB roles with `dpub: false`', () => {
+ const node = document.createElement('section');
node.setAttribute('role', 'doc-chapter');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode, { dpub: false }));
});
});
- describe('fallback', function () {
- it('returns the first valid item in the list', function () {
- var node = document.createElement('div');
+ describe('fallback', () => {
+ it('returns the first valid item in the list', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'link button');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode, { fallback: true }), 'link');
});
- it('skips over invalid roles', function () {
- var node = document.createElement('div');
+ it('skips over invalid roles', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'foobar button');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(aria.getExplicitRole(vNode, { fallback: true }), 'button');
});
- it('returns the null if all roles are invalid and there is no implicit role', function () {
- var node = document.createElement('div');
+ it('returns the null if all roles are invalid and there is no implicit role', () => {
+ const node = document.createElement('div');
node.setAttribute('role', 'foo bar baz');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.isNull(aria.getExplicitRole(vNode, { fallback: true }));
});
- it('respect the `abstracts` option', function () {
- var node = document.createElement('li');
+ it('respect the `abstracts` option', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'doc-chapter section');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(
aria.getExplicitRole(vNode, { fallback: true, abstracts: true }),
'section'
);
});
- it('respect the `dpub` option', function () {
- var node = document.createElement('li');
+ it('respect the `dpub` option', () => {
+ const node = document.createElement('li');
node.setAttribute('role', 'doc-chapter section');
- var vNode = flatTreeSetup(node)[0];
+ const vNode = flatTreeSetup(node)[0];
assert.equal(
aria.getExplicitRole(vNode, { fallback: true, dpub: true }),
'doc-chapter'
diff --git a/test/commons/table/is-data-cell.js b/test/commons/table/is-data-cell.js
index 20b3d43adf..3b163e32d4 100644
--- a/test/commons/table/is-data-cell.js
+++ b/test/commons/table/is-data-cell.js
@@ -1,93 +1,92 @@
-describe('table.isDataCell', function () {
- 'use strict';
- function $id(id) {
- return document.getElementById(id);
- }
+describe('table.isDataCell', () => {
+ const fixture = document.getElementById('fixture');
+ const flatTreeSetup = axe.testUtils.flatTreeSetup;
- var fixture = $id('fixture');
-
- afterEach(function () {
- fixture.innerHTML = '';
- });
-
- it('should work with TH', function () {
+ it('should work with TH', () => {
fixture.innerHTML =
'
' + '
1
' + '
';
+ flatTreeSetup(fixture);
- var target = $id('target');
+ const target = document.getElementById('target');
assert.isFalse(axe.commons.table.isDataCell(target));
});
- it('should work with TD', function () {
+ it('should work with TD', () => {
fixture.innerHTML =
'
' + '
1
' + '
';
+ flatTreeSetup(fixture);
- var target = $id('target');
+ const target = document.getElementById('target');
assert.isTrue(axe.commons.table.isDataCell(target));
});
- it('should work with empty TD', function () {
+ it('should work with empty TD', () => {
fixture.innerHTML =
'
' + '
' + '
';
+ flatTreeSetup(fixture);
- var target = $id('target');
+ const target = document.getElementById('target');
assert.isFalse(axe.commons.table.isDataCell(target));
});
- it('should ignore TDs with a valid role other than (grid)cell', function () {
+ it('should ignore TDs with a valid role other than (grid)cell', () => {
fixture.innerHTML =
'
' +
'
heading
' +
'
heading
' +
'
heading
' +
'
';
+ flatTreeSetup(fixture);
- var target1 = $id('target1');
- var target2 = $id('target2');
- var target3 = $id('target3');
+ const target1 = document.getElementById('target1');
+ const target2 = document.getElementById('target2');
+ const target3 = document.getElementById('target3');
assert.isFalse(axe.commons.table.isDataCell(target1));
assert.isFalse(axe.commons.table.isDataCell(target2));
assert.isFalse(axe.commons.table.isDataCell(target3));
});
- it('should return true for elements with role="(grid)cell"', function () {
+ it('should return true for elements with role="(grid)cell"', () => {
fixture.innerHTML =
'
';
+ flatTreeSetup(fixture);
- var target1 = $id('target1');
- var target2 = $id('target2');
+ const target1 = document.getElementById('target1');
+ const target2 = document.getElementById('target2');
assert.isTrue(axe.commons.table.isDataCell(target1));
assert.isFalse(axe.commons.table.isDataCell(target2));
});
diff --git a/test/commons/table/is-data-table.js b/test/commons/table/is-data-table.js
index c3607faf0b..054fe2865e 100644
--- a/test/commons/table/is-data-table.js
+++ b/test/commons/table/is-data-table.js
@@ -1,38 +1,31 @@
-describe('table.isDataTable', function () {
- 'use strict';
+describe('table.isDataTable', () => {
+ const fixture = document.getElementById('fixture');
- var fixture = document.getElementById('fixture');
-
- afterEach(function () {
- fixture.innerHTML = '';
- axe._tree = undefined;
- });
-
- it('should be false if the table has role=presentation', function () {
+ it('should be false if the table has role=presentation', () => {
fixture.innerHTML =
'
' +
'
1
2
' +
'
One
Two
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture);
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be false if the table has role=none', function () {
+ it('should be false if the table has role=none', () => {
fixture.innerHTML =
'
' +
'
1
2
' +
'
One
Two
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture);
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be true if the table is inside an editable area', function () {
+ it('should be true if the table is inside an editable area', () => {
fixture.innerHTML =
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a role of grid', function () {
+ it('should be true if the table has a role of grid', () => {
fixture.innerHTML = '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a role of treegrid', function () {
+ it('should be true if the table has a role of treegrid', () => {
fixture.innerHTML = '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the element has a role of table', function () {
+ it('should be true if the element has a role of table', () => {
fixture.innerHTML = '';
- var node = fixture.querySelector('[role="table"]');
+ const node = fixture.querySelector('[role="table"]');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- describe('should be true if the table has a landmark role', function () {
- it('application', function () {
+ describe('should be true if the table has a landmark role', () => {
+ it('application', () => {
fixture.innerHTML = '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
});
- it('should be false if the table has datatable=0', function () {
+ it('should be false if the table has datatable=0', () => {
fixture.innerHTML =
'
' +
'
1
2
' +
'
One
Two
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a summary attribute', function () {
+ it('should be true if the table has a summary attribute', () => {
fixture.innerHTML = '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a caption element', function () {
+ it('should be true if the table has a caption element', () => {
fixture.innerHTML = '
' + '
Hello
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a col element', function () {
+ it('should be true if the table has a col element', () => {
fixture.innerHTML = '
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a colgroup element', function () {
+ it('should be true if the table has a colgroup element', () => {
fixture.innerHTML = '
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a thead element', function () {
+ it('should be true if the table has a thead element', () => {
fixture.innerHTML = '
' + '' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a tfoot element', function () {
+ it('should be true if the table has a tfoot element', () => {
fixture.innerHTML = '
' + '' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a th element', function () {
+ it('should be true if the table has a th element', () => {
fixture.innerHTML = '
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a rowheader', function () {
+ it('should be true if the table has a rowheader', () => {
fixture.innerHTML =
'
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a columnheader', function () {
+ it('should be true if the table has a columnheader', () => {
fixture.innerHTML =
'
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a cell with headers attribute', function () {
+ it('should be true if the table has a cell with headers attribute', () => {
fixture.innerHTML =
'
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a cell with scope attribute', function () {
+ it('should be true if the table has a cell with scope attribute', () => {
fixture.innerHTML =
'
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a cell with abbr attribute', function () {
+ it('should be true if the table has a cell with abbr attribute', () => {
fixture.innerHTML =
'
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be true if the table has a cell with an abbr element as a single child', function () {
+ it('should be true if the table has a cell with an abbr element as a single child', () => {
fixture.innerHTML =
'
' + '
ok
' + '
';
- var node = fixture.querySelector('table');
+ let node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isFalse(axe.commons.table.isDataTable(node));
@@ -265,59 +258,59 @@ describe('table.isDataTable', function () {
assert.isTrue(axe.commons.table.isDataTable(node));
});
- it('should be false if it has a nested table', function () {
+ it('should be false if it has a nested table', () => {
fixture.innerHTML =
'
' +
'
' +
'
';
- var node = fixture.querySelector('#out');
+ const node = fixture.querySelector('#out');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' + '
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML = '
' + '
' + '
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
'
' +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
'
' +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
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', () => {
fixture.innerHTML =
'
' +
new Array(21).join('
') +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
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', () => {
fixture.innerHTML =
'
' +
new Array(3).join('
') +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
new Array(4).join('
') +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
new Array(4).join('
') +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
new Array(4).join('
') +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
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', () => {
fixture.innerHTML =
'
' +
new Array(4).join('
') +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isFalse(axe.commons.table.isDataTable(node));
});
// 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', () => {
fixture.innerHTML =
'
' +
new Array(4).join('
') +
'
' +
'
';
- var node = fixture.querySelector('table');
+ const node = fixture.querySelector('table');
axe.testUtils.flatTreeSetup(fixture.firstChild);
assert.isFalse(axe.commons.table.isDataTable(node));
});
- it('should otherwise be true', function () {
+ it('should otherwise be true', () => {
fixture.innerHTML =
'