Skip to content

Commit 08a7c43

Browse files
fix: add test for missing className
1 parent e4de706 commit 08a7c43

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
@@ -179,6 +179,21 @@ describe("style={undefined} should not destroy computed className styles", () =>
179179
});
180180
});
181181

182+
test("FlatList: className should map to style", () => {
183+
registerCSS(`.bg-red { background-color: red; }`);
184+
185+
const component = render(
186+
<FlatList
187+
testID={testID}
188+
data={[]}
189+
renderItem={() => null}
190+
className="bg-red"
191+
/>,
192+
).getByTestId(testID);
193+
194+
expect(component.props.style).toStrictEqual({ backgroundColor: "#f00" });
195+
});
196+
182197
// Path B: FlatList with columnWrapperClassName (another non-"style" array target)
183198
test("FlatList: contentContainerClassName with contentContainerStyle={undefined}", () => {
184199
registerCSS(`.p-4 { padding: 16px; }`);

0 commit comments

Comments
 (0)