Commit c0bf154
Re-enabled VirtualizedList "retains batch render region when an item is appended" test (#56653)
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
Pull Request resolved: #56653
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.
Reviewed By: cortinico
Differential Revision: D104291284
Pulled By: Abbondanzo
fbshipit-source-id: e32f8707a837a1805ce130d526768228f684e3e71 parent a3e87c6 commit c0bf154
1 file changed
Lines changed: 55 additions & 45 deletions
Lines changed: 55 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1836 | 1836 | | |
1837 | 1837 | | |
1838 | 1838 | | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1845 | 1842 | | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
1857 | 1854 | | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1864 | 1859 | | |
| 1860 | + | |
1865 | 1861 | | |
1866 | | - | |
1867 | | - | |
1868 | | - | |
| 1862 | + | |
1869 | 1863 | | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1881 | 1875 | | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
1889 | 1882 | | |
1890 | 1883 | | |
1891 | 1884 | | |
| |||
2639 | 2632 | | |
2640 | 2633 | | |
2641 | 2634 | | |
2642 | | - | |
| 2635 | + | |
2643 | 2636 | | |
2644 | 2637 | | |
2645 | 2638 | | |
2646 | 2639 | | |
2647 | 2640 | | |
2648 | 2641 | | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
2649 | 2659 | | |
2650 | 2660 | | |
2651 | 2661 | | |
| |||
0 commit comments