From 364d5cd0e27e44955e4756270bce5699ba4b1b71 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Tue, 11 Jul 2017 13:03:34 +0200 Subject: [PATCH] fix: Use testUtils in table tests --- lib/commons/aria/label.js | 4 ++-- test/checks/tables/td-has-header.js | 2 +- test/checks/tables/th-has-data-cells.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commons/aria/label.js b/lib/commons/aria/label.js index f9d14849e1..a3bbbfb655 100644 --- a/lib/commons/aria/label.js +++ b/lib/commons/aria/label.js @@ -8,8 +8,8 @@ aria.label = function (node) { var ref, candidate; if (node.actualNode instanceof Node === false) { - node = axe.utils.getNodeFromTree(axe._tree[0], node); - } + node = axe.utils.getNodeFromTree(axe._tree[0], node); + } if (node.actualNode.getAttribute('aria-labelledby')) { // aria-labelledby diff --git a/test/checks/tables/td-has-header.js b/test/checks/tables/td-has-header.js index df245d2af8..92accbdaff 100644 --- a/test/checks/tables/td-has-header.js +++ b/test/checks/tables/td-has-header.js @@ -2,7 +2,7 @@ describe('td-has-header', function () { 'use strict'; var fixture = document.getElementById('fixture'); - var shadowSupport = (document.body && typeof document.body.attachShadow === 'function'); + var shadowSupport = axe.testUtils.shadowSupport.v1; var checkContext = { _relatedNodes: [], _data: null, diff --git a/test/checks/tables/th-has-data-cells.js b/test/checks/tables/th-has-data-cells.js index 8ffe5e9b32..8f0703cfaf 100644 --- a/test/checks/tables/th-has-data-cells.js +++ b/test/checks/tables/th-has-data-cells.js @@ -2,7 +2,7 @@ describe('th-has-data-cells', function () { 'use strict'; var fixture = document.getElementById('fixture'); - var shadowSupport = (document.body && typeof document.body.attachShadow === 'function'); + var shadowSupport = axe.testUtils.shadowSupport.v1; var checkContext = { _relatedNodes: [], _data: null,