Skip to content

Commit 4755b91

Browse files
committed
fix tests and lint
1 parent 53f9158 commit 4755b91

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

packages/@react-aria/virtualizer/src/ScrollView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
213213
// due to strict mode.
214214
setUpdate({});
215215
lastContentSize.current = contentSize;
216-
return
216+
return;
217217
} else {
218218
queueMicrotask(() => updateSize(flushSync));
219219
}
@@ -225,7 +225,7 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
225225
// Will only run in tests, needs to be in separate effect so it is properly run in the next render in strict mode.
226226
useLayoutEffect(() => {
227227
updateSize(fn => fn());
228-
}, [update])
228+
}, [update]);
229229

230230
let onResize = useCallback(() => {
231231
updateSize(flushSync);

packages/react-aria-components/test/GridList.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,15 +946,14 @@ describe('GridList', () => {
946946

947947
let tree = render(<AsyncGridList items={items} onLoadMore={onLoadMore} isLoading />);
948948
let sentinel = tree.getByTestId('loadMoreSentinel');
949-
expect(observe).toHaveBeenCalledTimes(2);
950949
expect(observe).toHaveBeenLastCalledWith(sentinel);
951950
expect(onLoadMore).toHaveBeenCalledTimes(0);
952951

953952
act(() => {observer.instance.triggerCallback([{isIntersecting: true}]);});
954953
expect(onLoadMore).toHaveBeenCalledTimes(1);
954+
observe.mockClear();
955955

956956
tree.rerender(<AsyncGridList items={items} onLoadMore={onLoadMore} />);
957-
expect(observe).toHaveBeenCalledTimes(3);
958957
expect(observe).toHaveBeenLastCalledWith(sentinel);
959958
expect(onLoadMore).toHaveBeenCalledTimes(1);
960959

packages/react-aria-components/test/ListBox.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,15 +1417,14 @@ describe('ListBox', () => {
14171417

14181418
let tree = render(<AsyncListbox items={items} onLoadMore={onLoadMore} isLoading />);
14191419
let sentinel = tree.getByTestId('loadMoreSentinel');
1420-
expect(observe).toHaveBeenCalledTimes(2);
14211420
expect(observe).toHaveBeenLastCalledWith(sentinel);
14221421
expect(onLoadMore).toHaveBeenCalledTimes(0);
14231422

14241423
act(() => {observer.instance.triggerCallback([{isIntersecting: true}]);});
14251424
expect(onLoadMore).toHaveBeenCalledTimes(1);
1425+
observe.mockClear();
14261426

14271427
tree.rerender(<AsyncListbox items={items} onLoadMore={onLoadMore} />);
1428-
expect(observe).toHaveBeenCalledTimes(3);
14291428
expect(observe).toHaveBeenLastCalledWith(sentinel);
14301429
expect(onLoadMore).toHaveBeenCalledTimes(1);
14311430

packages/react-aria-components/test/Table.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,15 +1931,14 @@ describe('Table', () => {
19311931

19321932
let tree = render(<LoadMoreTable items={items} onLoadMore={onLoadMore} isLoading />);
19331933
let sentinel = tree.getByTestId('loadMoreSentinel');
1934-
expect(observe).toHaveBeenCalledTimes(2);
19351934
expect(observe).toHaveBeenLastCalledWith(sentinel);
19361935
expect(onLoadMore).toHaveBeenCalledTimes(0);
1936+
observe.mockClear();
19371937

19381938
act(() => {observer.instance.triggerCallback([{isIntersecting: true}]);});
19391939
expect(onLoadMore).toHaveBeenCalledTimes(1);
19401940

19411941
tree.rerender(<LoadMoreTable items={items} onLoadMore={onLoadMore} />);
1942-
expect(observe).toHaveBeenCalledTimes(3);
19431942
expect(observe).toHaveBeenLastCalledWith(sentinel);
19441943
expect(onLoadMore).toHaveBeenCalledTimes(1);
19451944

0 commit comments

Comments
 (0)