Add E2E test for FabricInteropLayer (#51269)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51269

This adds an E2E Tests for the fabric interop layer in RNTester, so we can make sure that we don't break the mechanism to add children after the view is rendered

## Changelog:
[Internal] - Add E2E test for FabricInteropLayer

Reviewed By: sammy-SC

Differential Revision: D74590458

fbshipit-source-id: 9483d1ac648d923a8494d6402b9b2f971b9b2547
This commit is contained in:
Riccardo Cipolleschi
2025-05-14 10:11:03 -07:00
committed by Facebook GitHub Bot
parent d53a60dd23
commit 8d634267f8
@@ -23,6 +23,7 @@ import {
type SectionProps = {
title: string,
testID?: string,
children?: React.Node,
};
@@ -82,13 +83,21 @@ function AddChildrenForInteropLayer() {
backgroundColor: isDarkMode ? BLACK : WHITE,
}}>
<Section title="Squares">
<Button title="Add Marker" onPress={addMarker} />
<Button
title="Add Marker"
onPress={addMarker}
testID="add-marker-btn"
/>
<Text>{`Number of squares: ${squares.length}`}</Text>
</Section>
<Section title="Custom native view">
<Section title="Custom native view" testID="interop-view-content">
<InteropTestView style={styles.customView}>
{squares.map((_, index) => (
<View key={index} style={styles.customViewChild} />
<View
key={index}
style={styles.customViewChild}
testID={`marker_${index}`}
/>
))}
</InteropTestView>
</Section>
@@ -134,16 +143,16 @@ const styles = StyleSheet.create({
},
});
exports.title = 'Fabric Interop Layer';
exports.title = 'FabricInteropLayer';
exports.category = 'UI';
exports.description = 'A set test cases for the Fabric Interop Layer.';
exports.examples = [
{
title: 'Add children to Interop Layer',
description: 'Add children to Interop Layer',
name: 'Add Children to interop layer',
name: 'add-children',
render(): React.Node {
return <AddChildrenForInteropLayer />;
return <AddChildrenForInteropLayer testID="add-children" />;
},
},
];