Skip to content

Commit 94c7285

Browse files
committed
Do not make assumptions on cell structure
1 parent 8cdaa82 commit 94c7285

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Libraries/Lists/__tests__/VirtualizedList-test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,8 +1471,7 @@ it('keeps last focused item rendered', () => {
14711471
});
14721472

14731473
ReactTestRenderer.act(() => {
1474-
const cell3 = component.root.findByProps({value: 3});
1475-
cell3.parent.props.onFocusCapture(null);
1474+
component.getInstance()._onCellFocusCapture(3);
14761475
});
14771476

14781477
ReactTestRenderer.act(() => {
@@ -1484,8 +1483,7 @@ it('keeps last focused item rendered', () => {
14841483
expect(component).toMatchSnapshot();
14851484

14861485
ReactTestRenderer.act(() => {
1487-
const cell17 = component.root.findByProps({value: 17});
1488-
cell17.parent.props.onFocusCapture(null);
1486+
component.getInstance()._onCellFocusCapture(17);
14891487
});
14901488

14911489
// Cells 2-4 should no longer be rendered after focus is moved to the end of

0 commit comments

Comments
 (0)