Skip to content

Commit 95e9ee7

Browse files
fix: add test for missing className
1 parent afdbb86 commit 95e9ee7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/__tests__/native/className-with-style.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ test("View with multiple className properties where inline style takes precedenc
9999
]);
100100
});
101101

102+
test("FlatList: className should map to style", () => {
103+
registerCSS(`.bg-red { background-color: red; }`);
104+
105+
const component = render(
106+
<FlatList
107+
testID={testID}
108+
data={[]}
109+
renderItem={() => null}
110+
className="bg-red"
111+
/>,
112+
).getByTestId(testID);
113+
114+
expect(component.props.style).toStrictEqual({ backgroundColor: "#f00" });
115+
});
116+
102117
/**
103118
* Tests for style={undefined} not destroying computed className styles.
104119
*

0 commit comments

Comments
 (0)