From dcd60dc8ddf22bee67c71c4efb0309c44c1854c7 Mon Sep 17 00:00:00 2001 From: Antoine Doubovetzky Date: Sun, 3 Apr 2022 11:44:30 +0200 Subject: [PATCH] :fire: (VirtualizedList-test) remove unrelevant test case This test case is unrelevant because we do not need to simulate a scroll to check that the render area has been adjusted, and this behavior is already tested by "adjusts render area with non-zero initialScrollIndex". --- .../Lists/__tests__/VirtualizedList-test.js | 36 +-- .../VirtualizedList-test.js.snap | 231 +----------------- 2 files changed, 2 insertions(+), 265 deletions(-) diff --git a/Libraries/Lists/__tests__/VirtualizedList-test.js b/Libraries/Lists/__tests__/VirtualizedList-test.js index 4aa0972270a2fd..4429147718421c 100644 --- a/Libraries/Lists/__tests__/VirtualizedList-test.js +++ b/Libraries/Lists/__tests__/VirtualizedList-test.js @@ -862,40 +862,7 @@ it('does not adjust render area until content area layed out', () => { expect(component).toMatchSnapshot(); }); -it('does not adjust render area with non-zero initialScrollIndex until scrolled', () => { - const items = generateItems(20); - const ITEM_HEIGHT = 10; - - let component; - ReactTestRenderer.act(() => { - component = ReactTestRenderer.create( - , - ); - }); - - ReactTestRenderer.act(() => { - simulateLayout(component, { - viewport: {width: 10, height: 50}, - content: {width: 10, height: 200}, - }); - performAllBatches(); - }); - - // Layout information from before the time we scroll to initial index may not - // correspond to the area "initialScrollIndex" points to. Expect only the 5 - // initial items (starting at initialScrollIndex) to be rendered after - // processing all batch work, even though the windowSize allows for more. - expect(component).toMatchSnapshot(); -}); - -it('adjusts render area with non-zero initialScrollIndex after scrolled', () => { +it('adjusts render area with non-zero initialScrollIndex', () => { const items = generateItems(20); const ITEM_HEIGHT = 10; @@ -919,7 +886,6 @@ it('adjusts render area with non-zero initialScrollIndex after scrolled', () => content: {width: 10, height: 200}, }); - simulateScroll(component, {x: 0, y: 10}); performAllBatches(); }); diff --git a/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap b/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap index 037d1d769fe3f5..7c8cbb8edd6f5f 100644 --- a/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +++ b/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap @@ -1600,7 +1600,7 @@ exports[`VirtualizedList warns if both renderItem or ListItemComponent are speci `; -exports[`adjusts render area with non-zero initialScrollIndex after scrolled 1`] = ` +exports[`adjusts render area with non-zero initialScrollIndex 1`] = ` `; -exports[`does not adjust render area with non-zero initialScrollIndex until scrolled 1`] = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; - exports[`does not over-render when there is less than initialNumToRender cells 1`] = `