Skip to content

Commit a7a6905

Browse files
committed
chore: linting
1 parent 160f0cd commit a7a6905

1 file changed

Lines changed: 37 additions & 40 deletions

File tree

packages/virtualized-lists/Lists/__tests__/VirtualizedList-test.js

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,52 +1836,49 @@ it('retains initial render region when an item is appended', async () => {
18361836
expect(component).toMatchSnapshot();
18371837
});
18381838

1839-
it(
1840-
'retains batch render region when an item is appended',
1841-
async () => {
1842-
const items = generateItems(10);
1843-
const ITEM_HEIGHT = 10;
1839+
it('retains batch render region when an item is appended', async () => {
1840+
const items = generateItems(10);
1841+
const ITEM_HEIGHT = 10;
18441842

1845-
let component;
1846-
await act(() => {
1847-
component = create(
1848-
<VirtualizedList
1849-
initialNumToRender={1}
1850-
maxToRenderPerBatch={1}
1851-
{...baseItemProps(items)}
1852-
{...fixedHeightItemLayoutProps(ITEM_HEIGHT)}
1853-
/>,
1854-
);
1855-
});
1843+
let component;
1844+
await act(() => {
1845+
component = create(
1846+
<VirtualizedList
1847+
initialNumToRender={1}
1848+
maxToRenderPerBatch={1}
1849+
{...baseItemProps(items)}
1850+
{...fixedHeightItemLayoutProps(ITEM_HEIGHT)}
1851+
/>,
1852+
);
1853+
});
18561854

1857-
await act(() => {
1858-
simulateLayout(component, {
1859-
viewport: {width: 10, height: 50},
1860-
content: {width: 10, height: 100},
1861-
});
1855+
await act(() => {
1856+
simulateLayout(component, {
1857+
viewport: {width: 10, height: 50},
1858+
content: {width: 10, height: 100},
18621859
});
1860+
});
18631861

1864-
await advanceUntilLastCellIndexRendered(component, items.length - 1);
1862+
await advanceUntilLastCellIndexRendered(component, items.length - 1);
18651863

1866-
await act(() => {
1867-
component.update(
1868-
<VirtualizedList
1869-
initialNumToRender={1}
1870-
maxToRenderPerBatch={1}
1871-
{...baseItemProps(items)}
1872-
{...fixedHeightItemLayoutProps(ITEM_HEIGHT)}
1873-
data={generateItems(11)}
1874-
/>,
1875-
);
1876-
});
1864+
await act(() => {
1865+
component.update(
1866+
<VirtualizedList
1867+
initialNumToRender={1}
1868+
maxToRenderPerBatch={1}
1869+
{...baseItemProps(items)}
1870+
{...fixedHeightItemLayoutProps(ITEM_HEIGHT)}
1871+
data={generateItems(11)}
1872+
/>,
1873+
);
1874+
});
18771875

1878-
// Adding an item to the list after batch render should keep the existing
1879-
// rendered items rendered. We batch render 10 items, then add an 11th. Expect
1880-
// the first ten items to be present, with a spacer for the 11th until the
1881-
// next batch render.
1882-
expect(component).toMatchSnapshot();
1883-
},
1884-
);
1876+
// Adding an item to the list after batch render should keep the existing
1877+
// rendered items rendered. We batch render 10 items, then add an 11th. Expect
1878+
// the first ten items to be present, with a spacer for the 11th until the
1879+
// next batch render.
1880+
expect(component).toMatchSnapshot();
1881+
});
18851882

18861883
it('constrains batch render region when an item is removed', async () => {
18871884
const items = generateItems(10);

0 commit comments

Comments
 (0)