Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit b46d451

Browse files
committed
add rest of axe-core tests
1 parent 0d6722e commit b46d451

File tree

18 files changed

+285
-0
lines changed

18 files changed

+285
-0
lines changed

Card/test.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import Card from './index';
4+
5+
describe('Card', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<Card>
9+
What is a Product Designer? An awesome story by @jgadapee over on Medium!
10+
</Card>, [], (results) => {
11+
expect(results.violations.length).toBe(0);
12+
done();
13+
});
14+
});
15+
});

Icon/test.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import ArrowLeftIcon from './Icons/ArrowLeftIcon';
4+
5+
describe('Icon', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(<ArrowLeftIcon />, [], (results) => {
8+
expect(results.violations.length).toBe(0);
9+
done();
10+
});
11+
});
12+
});

IdTag/test.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import IdTag from './index';
4+
5+
describe('IdTag', () => {
6+
it('should pass accessibility audit', (done) => {
7+
const children = 'GIF';
8+
a11yTestHelper.testComponent(
9+
<IdTag>
10+
{children}
11+
</IdTag>, [], (results) => {
12+
expect(results.violations.length).toBe(0);
13+
done();
14+
});
15+
});
16+
});

Image/test.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import Image from './index';
4+
5+
describe('Image', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<Image
9+
src={'http://lorempixel.com/400/400/cats/'}
10+
height={'14em'}
11+
maxWidth={'10em'}
12+
/>, [], (results) => {
13+
expect(results.violations.length).toBe(0);
14+
done();
15+
});
16+
});
17+
});

Input/test.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import Input from './index';
4+
5+
describe('Input', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<Input
9+
label={'Username'}
10+
placeholder={'ex: kitteh1234'}
11+
/>, [], (results) => {
12+
expect(results.violations.length).toBe(0);
13+
done();
14+
});
15+
});
16+
});

InputEmail/test.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import InputEmail from './index';
4+
5+
describe('InputEmail', () => {
6+
it('should pass accessibility audit', (done) => {
7+
const onChange = () => false;
8+
const input = {
9+
10+
onChange,
11+
};
12+
a11yTestHelper.testComponent(
13+
<InputEmail input={input} label={'Email'} />, [], (results) => {
14+
expect(results.violations.length).toBe(0);
15+
done();
16+
});
17+
});
18+
});

Link/test.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ import React from 'react';
22
import { mount } from 'enzyme';
33
import LinkStateless from '../LinkStateless';
44
import Link from './index';
5+
import a11yTestHelper from '../lib/a11yTestHelper';
56

67
describe('Link', () => {
8+
it('should pass accessibility audit', (done) => {
9+
a11yTestHelper.testComponent(
10+
<Link href={'localhost:8000'}>A Link</Link>, [], (results) => {
11+
expect(results.violations.length).toBe(0);
12+
done();
13+
});
14+
});
715
it('should toggle hovered prop when mouseEnter and mouseLeave are triggered', () => {
816
const wrapper = mount(
917
<Link href={'localhost:8000'}>A Link</Link>,

LinkStateless/test.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import LinkStateless from './index';
4+
5+
describe('LinkStateless', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<LinkStateless href={'https://buffer.com'}>Buffer</LinkStateless>, [], (results) => {
9+
expect(results.violations.length).toBe(0);
10+
done();
11+
});
12+
});
13+
});

LinkifiedText/test.jsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import LinkifiedText from './index';
4+
5+
describe('LinkifiedText', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<LinkifiedText
9+
links={[{
10+
rawString: 'http://t.co/0JG5Mcq',
11+
displayString: 'blog.twitter.com/2011/05/twitte…',
12+
url: 'http://blog.twitter.com/2011/05/twitter-for-mac-update.html',
13+
indices: [2, 21],
14+
}]}
15+
>
16+
{'a http://t.co/0JG5Mcq b'}
17+
</LinkifiedText>, [], (results) => {
18+
expect(results.violations.length).toBe(0);
19+
done();
20+
});
21+
});
22+
});

List/test.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import a11yTestHelper from '../lib/a11yTestHelper';
3+
import List from './index';
4+
5+
describe('List', () => {
6+
it('should pass accessibility audit', (done) => {
7+
a11yTestHelper.testComponent(
8+
<List items={['apples', 'bananas', 'oranges']} />, [], (results) => {
9+
expect(results.violations.length).toBe(0);
10+
done();
11+
});
12+
});
13+
});

0 commit comments

Comments
 (0)