-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path@apply.test.tsx
More file actions
42 lines (37 loc) · 940 Bytes
/
@apply.test.tsx
File metadata and controls
42 lines (37 loc) · 940 Bytes
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
import { screen } from "@testing-library/react-native";
import { View } from "react-native-css/components";
import { render } from "./_tailwind";
const testID = "react-native-css-interop";
test("@apply", async () => {
await render(<View testID={testID} className="btn-primary" />, {
extraCss: `
.btn-primary {
@apply py-2 px-4 bg-blue-500 text-white font-semibold rounded-lg shadow-md;
}`,
});
const component = screen.getByTestId(testID);
expect(component).toHaveStyle({
backgroundColor: "#2b7fff",
borderRadius: 7,
color: "#fff",
fontWeight: 600,
paddingBlock: 7,
paddingInline: 14,
boxShadow: [
{
offsetX: 0,
offsetY: 4,
blurRadius: 6,
spreadDistance: -1,
color: "#0000001a",
},
{
offsetX: 0,
offsetY: 2,
blurRadius: 4,
spreadDistance: -2,
color: "#0000001a",
},
],
});
});