diff --git a/Button/test.jsx b/Button/test.jsx index 7078be3c..cefca9b3 100644 --- a/Button/test.jsx +++ b/Button/test.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { mount } from 'enzyme'; import ButtonStateless from '../ButtonStateless'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Button from './index'; describe('Button', () => { diff --git a/Card/test.jsx b/Card/test.jsx index b6a226d7..225e18b7 100644 --- a/Card/test.jsx +++ b/Card/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Card from './index'; describe('Card', () => { diff --git a/Icon/test.jsx b/Icon/test.jsx index 89e145b4..e6526fa3 100644 --- a/Icon/test.jsx +++ b/Icon/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import ArrowLeftIcon from './Icons/ArrowLeftIcon'; describe('Icon', () => { diff --git a/IdTag/test.jsx b/IdTag/test.jsx index 8f2ffe2f..f6941ad5 100644 --- a/IdTag/test.jsx +++ b/IdTag/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import IdTag from './index'; describe('IdTag', () => { diff --git a/Image/test.jsx b/Image/test.jsx index 023fb47e..bdef7ff7 100644 --- a/Image/test.jsx +++ b/Image/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Image from './index'; describe('Image', () => { diff --git a/InputDate/test.jsx b/InputDate/test.jsx index 43675afd..33ae573d 100644 --- a/InputDate/test.jsx +++ b/InputDate/test.jsx @@ -1,6 +1,5 @@ import React from 'react'; import { mount } from 'enzyme'; -import { testComponentA11y } from '../lib/a11yTestHelper'; import InputDate from './index'; describe('InputDate', () => { diff --git a/InputTime/test.jsx b/InputTime/test.jsx index 6e5ef0af..c4a2cd03 100644 --- a/InputTime/test.jsx +++ b/InputTime/test.jsx @@ -1,19 +1,8 @@ import React from 'react'; import { mount } from 'enzyme'; -import { testComponentA11y } from '../lib/a11yTestHelper'; import InputTime from './index'; describe('InputTime', () => { - it('should pass accessibility audit', () => { - const onChange = jest.fn(); - return testComponentA11y(, - ) - .then(results => expect(results.violations.length).toBe(0)); - }); it('should trigger onChange when hour is selected', () => { const onChange = jest.fn(); const wrapper = mount( diff --git a/Link/test.jsx b/Link/test.jsx index 27313cab..3cb8fbcc 100644 --- a/Link/test.jsx +++ b/Link/test.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { mount } from 'enzyme'; import LinkStateless from '../LinkStateless'; import Link from './index'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; describe('Link', () => { it('should pass accessibility audit', () => testComponentA11y( diff --git a/LinkStateless/test.jsx b/LinkStateless/test.jsx index eaa4c187..6b4da9dc 100644 --- a/LinkStateless/test.jsx +++ b/LinkStateless/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import LinkStateless from './index'; describe('LinkStateless', () => { diff --git a/LinkifiedText/test.jsx b/LinkifiedText/test.jsx index cdfd66d4..b8f26f3c 100644 --- a/LinkifiedText/test.jsx +++ b/LinkifiedText/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import LinkifiedText from './index'; describe('LinkifiedText', () => { diff --git a/List/test.jsx b/List/test.jsx index b2f2b40c..92ebd8de 100644 --- a/List/test.jsx +++ b/List/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import List from './index'; describe('List', () => { diff --git a/Loader/test.jsx b/Loader/test.jsx index 34784ac8..c2cd909c 100644 --- a/Loader/test.jsx +++ b/Loader/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Loader from './index'; describe('Loader', () => { diff --git a/MultipleImages/test.jsx b/MultipleImages/test.jsx index 2ff8677b..4ef9e898 100644 --- a/MultipleImages/test.jsx +++ b/MultipleImages/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import MultipleImages from './index'; describe('MultipleImages', () => { diff --git a/NavBar/test.jsx b/NavBar/test.jsx index f86c48bd..0754f853 100644 --- a/NavBar/test.jsx +++ b/NavBar/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import NavBar from './index'; describe('NavBar', () => { diff --git a/Overlay/test.jsx b/Overlay/test.jsx index 1d8f099b..70d65e14 100644 --- a/Overlay/test.jsx +++ b/Overlay/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Overlay from './index'; import Image from '../Image/index'; diff --git a/Popover/test.jsx b/Popover/test.jsx index a4143973..7d6f1a3c 100644 --- a/Popover/test.jsx +++ b/Popover/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Popover from './index'; import Card from '../Card/index'; diff --git a/SectionHeader/test.jsx b/SectionHeader/test.jsx index c32bf978..c2ea7733 100644 --- a/SectionHeader/test.jsx +++ b/SectionHeader/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import SectionHeader from './index'; describe('SectionHeader', () => { diff --git a/Select/test.jsx b/Select/test.jsx index 7e33c159..365e3f03 100644 --- a/Select/test.jsx +++ b/Select/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Select from './index'; describe('Select', () => { diff --git a/Video/test.jsx b/Video/test.jsx index 5d8b6c3b..f49318c5 100644 --- a/Video/test.jsx +++ b/Video/test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { testComponentA11y } from '../lib/a11yTestHelper'; +import testComponentA11y from '../lib/a11yTestHelper'; import Video from './index'; describe('Video', () => { diff --git a/lib/a11yTestHelper.js b/lib/a11yTestHelper.js index e79571ce..9519d42e 100644 --- a/lib/a11yTestHelper.js +++ b/lib/a11yTestHelper.js @@ -24,17 +24,6 @@ const report = (results) => { } }; -/** - * Run an aXe audit. - * @private - * - * @param {object} node - A node reference from your app. - * @param {object} config - An aXe config or empty object. - */ -const a11yCheck = (node, config) => { - -}; - /** * Test a component with Enzyme. * @@ -43,7 +32,7 @@ const a11yCheck = (node, config) => { * [axe.a11yCheck](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter). * @param {function} callback - A callback function to execute when aXe returns. */ -export const testComponentA11y = (app, config = []) => { +const testComponentA11y = (app, config = []) => { const div = document.createElement('div'); //eslint-disable-line document.body.appendChild(div); //eslint-disable-line @@ -64,3 +53,5 @@ export const testComponentA11y = (app, config = []) => { }); }); }; + +export default testComponentA11y;