forked from callstack/react-native-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckbox.test.js
51 lines (39 loc) · 1.23 KB
/
Checkbox.test.js
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
import * as React from 'react';
import renderer from 'react-test-renderer';
import Checkbox from '../Checkbox.tsx';
it('renders checked Checkbox with onPress', () => {
const tree = renderer
.create(<Checkbox status="checked" onPress={() => {}} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders unchecked Checkbox with onPress', () => {
const tree = renderer
.create(<Checkbox status="unchecked" onPress={() => {}} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders indeterminate Checkbox', () => {
const tree = renderer
.create(<Checkbox status="indeterminate" onPress={() => {}} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders checked Checkbox with color', () => {
const tree = renderer
.create(<Checkbox status="checked" color="red" />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders unchecked Checkbox with color', () => {
const tree = renderer
.create(<Checkbox status="checked" color="red" />)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders indeterminate Checkbox with color', () => {
const tree = renderer
.create(<Checkbox status="indeterminate" color="red" />)
.toJSON();
expect(tree).toMatchSnapshot();
});