forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha11y-spec.js
More file actions
63 lines (55 loc) · 1.74 KB
/
a11y-spec.js
File metadata and controls
63 lines (55 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Loading from '../../src/loading/index';
import '../../src/loading/style.js';
import { testReact, unmount } from '../util/a11y/validate';
/* eslint-disable react/jsx-filename-extension */
/* global describe it afterEach*/
Enzyme.configure({ adapter: new Adapter() });
describe('Loading', () => {
let wrapper;
afterEach(() => {
if (wrapper) {
wrapper.unmount();
wrapper = null;
}
unmount();
});
it('should not have any violations', async () => {
wrapper = await testReact(
<Loading visible tip="loading...">
<div className="demo">test</div>
</Loading>,
{ incomplete: true }
);
return wrapper;
});
it('should not have any violations when hidden', async () => {
wrapper = await testReact(
<Loading tip="loading...">
<div className="demo">test</div>
</Loading>,
{ incomplete: true }
);
return wrapper;
});
it('should not have any violations when fullscreen', async () => {
wrapper = await testReact(
<Loading visible tip="loading..." fullScreen>
<div className="demo">test</div>
</Loading>,
{ incomplete: true }
);
return wrapper;
});
it('should not have any violations when inline', async () => {
wrapper = await testReact(
<Loading visible tip="loading..." inline={false}>
<div className="demo">test</div>
</Loading>,
{ incomplete: true }
);
return wrapper;
});
});