From 94c728559518b9b492a7cbd48a1ab0f4b1a02e66 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 23 Nov 2021 02:45:55 -0800 Subject: [PATCH] Do not make assumptions on cell structure --- Libraries/Lists/__tests__/VirtualizedList-test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js index 272b2d0499844c..6ec0a178c3b0ba 100644 --- a/Libraries/Lists/__tests__/VirtualizedList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedList-test.js @@ -1471,8 +1471,7 @@ it('keeps last focused item rendered', () => { }); ReactTestRenderer.act(() => { - const cell3 = component.root.findByProps({value: 3}); - cell3.parent.props.onFocusCapture(null); + component.getInstance()._onCellFocusCapture(3); }); ReactTestRenderer.act(() => { @@ -1484,8 +1483,7 @@ it('keeps last focused item rendered', () => { expect(component).toMatchSnapshot(); ReactTestRenderer.act(() => { - const cell17 = component.root.findByProps({value: 17}); - cell17.parent.props.onFocusCapture(null); + component.getInstance()._onCellFocusCapture(17); }); // Cells 2-4 should no longer be rendered after focus is moved to the end of