mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-13 01:18:18 +08:00
27 lines
662 B
TypeScript
27 lines
662 B
TypeScript
import { Svg, Circle } from "react-native-svg";
|
|
import { render } from "@testing-library/react-native";
|
|
import { TestProvider } from "./runner";
|
|
import { styled } from "../../src";
|
|
|
|
const cases: Array<[string, string]> = [
|
|
["0", "0"],
|
|
["1", "1"],
|
|
["2", "2"],
|
|
];
|
|
|
|
const StyledCircle = styled(Circle, { classProps: ["fill", "stroke"] });
|
|
|
|
describe("Svg - Stroke Width", () => {
|
|
test.each(cases)("stroke-%s", (unit) => {
|
|
const tree = render(
|
|
<TestProvider css={`stroke-${unit}`}>
|
|
<Svg>
|
|
<StyledCircle stroke={`stroke-${unit}`} />
|
|
</Svg>
|
|
</TestProvider>
|
|
).toJSON();
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
});
|
|
});
|