-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathenv.test.ios.tsx
More file actions
35 lines (31 loc) · 1.05 KB
/
env.test.ios.tsx
File metadata and controls
35 lines (31 loc) · 1.05 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
// import { SafeAreaProvider } from "react-native-css/components/SafeAreaProvider";
import { render, screen } from "@testing-library/react-native";
import { View } from "react-native-css/components/View";
import { registerCSS, testID } from "react-native-css/jest";
test.skip("safe-area-inset-*", () => {
registerCSS(`.my-class {
margin-top: env(safe-area-inset-top);
margin-bottom: env(safe-area-inset-bottom);
margin-left: env(safe-area-inset-left);
margin-right: env(safe-area-inset-right);
}`);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const SafeAreaProvider = View as any;
render(
<SafeAreaProvider
initialMetrics={{
insets: { top: 1, bottom: 2, left: 3, right: 4 },
frame: { x: 0, y: 0, width: 0, height: 0 },
}}
>
<View testID={testID} className="my-class" />
</SafeAreaProvider>,
);
const component = screen.getByTestId(testID);
expect(component.props.style).toStrictEqual({
marginTop: 1,
marginBottom: 2,
marginLeft: 3,
marginRight: 4,
});
});