Skip to content

Re-enabled VirtualizedList "retains batch render region when an item is appended" test#56653

Open
chicio wants to merge 2 commits intofacebook:mainfrom
chicio:virtualizedlist_retain_region_item_append_test
Open

Re-enabled VirtualizedList "retains batch render region when an item is appended" test#56653
chicio wants to merge 2 commits intofacebook:mainfrom
chicio:virtualizedlist_retain_region_item_append_test

Conversation

@chicio
Copy link
Copy Markdown
Contributor

@chicio chicio commented Apr 29, 2026

Summary:

This PR is a follow-up of #56358, in order to improve and VirtualizedList tests.
I re-enabled the skipped test retains batch render region when an item is appended.
With React 19, the previous approach that was using jest.runAllTimersAsync in this test path was unstable because the pre-update render region could still be processing updates.
I adopted the same approach used in #56358 by introducing a small helper function, advanceUntilLastCellIndexRendered, which advances timers one step at a time and stops when the expected state is reached: cellsAroundViewport.last === items.length - 1.

As part of this follow-up, I also aligned advanceUntilRenderAreaChanged to use performNextBatch for consistent stepwise timer advancement.

Changelog:

[GENERAL][FIXED] - Re-enabled VirtualizedList "retains batch render region when an item is appended" tes

Test Plan:

  • Ran the VirtualizedList-test.js and verified all test cases passed.
  • Verified test modification correctness by intentionally breaking the related snapshot and check that it is breaking/it is failing.

chicio and others added 2 commits April 28, 2026 00:13
…d (react 19 differen)

Co-authored-by: Copilot <copilot@github.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 29, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant