forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckbox.android.js
More file actions
38 lines (35 loc) · 1.01 KB
/
Checkbox.android.js
File metadata and controls
38 lines (35 loc) · 1.01 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
import "react-native";
import React from "react";
import renderer from "react-test-renderer";
import { Content } from "./../../src/basic/Content";
import { ListItem } from "./../../src/basic/ListItem";
import { CheckBox } from "./../../src/basic/Checkbox";
import { Body } from "./../../src/basic/Body";
import { Text } from "./../../src/basic/Text";
// Note: test renderer must be required after react-native.
jest.mock("Platform", () => {
const Platform = require.requireActual("Platform");
Platform.OS = "android";
return Platform;
});
it("renders checkbox", () => {
const tree = renderer
.create(
<Content>
<ListItem button>
<CheckBox checked={true} />
<Body>
<Text>Lunch Break</Text>
</Body>
</ListItem>
<ListItem button>
<CheckBox color="red" checked={false} />
<Body>
<Text>Daily Stand Up</Text>
</Body>
</ListItem>
</Content>
)
.toJSON();
expect(tree).toMatchSnapshot();
});