From 9ece93ea6722b88541c061203f3510ab962610eb Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 20 Feb 2025 02:32:50 -0800 Subject: [PATCH] add unit test for view culling when parent has transform (#49535) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49535 changelog: [internal] Add a unit test to cover scenario where ScrollView's parent has a transform Reviewed By: NickGerleman Differential Revision: D69860855 fbshipit-source-id: 1b64665c5b15ad2e5e068d4c6d56f9694ac7cf03 --- .../__tests__/ScrollView-viewCulling-itest.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js index fe3d7833eee..cfd871c6896 100644 --- a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js +++ b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js @@ -812,3 +812,32 @@ test('culling with transform scale', () => { 'Update {type: "ScrollView", nativeID: (N/A)}', ]); }); + +test('culling when ScrollView parent has transform', () => { + const root = Fantom.createRoot({viewportWidth: 100, viewportHeight: 100}); + + Fantom.runTask(() => { + root.render( + + + + + , + ); + }); + + expect(root.takeMountingManagerLogs()).toEqual([ + 'Update {type: "RootView", nativeID: (root)}', + 'Create {type: "View", nativeID: (N/A)}', + 'Create {type: "ScrollView", nativeID: (N/A)}', + 'Create {type: "View", nativeID: (N/A)}', + 'Create {type: "View", nativeID: "child"}', + 'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: "child"}', + 'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: (N/A)}', + 'Insert {type: "ScrollView", parentNativeID: (N/A), index: 0, nativeID: (N/A)}', + 'Insert {type: "View", parentNativeID: (root), index: 0, nativeID: (N/A)}', + ]); +});