Skip to content

Commit 268ff06

Browse files
authored
write tests for triggerOnNoScroll (#69)
1 parent 66e5ebd commit 268ff06

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/hook/index.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ describe('useBottomScrollListener', () => {
5858

5959
expect(onBottom).toHaveBeenCalledTimes(1);
6060
});
61+
62+
it('shall invoke onBottom when there is no place to scroll with triggerOnNoScroll true', () => {
63+
const onBottom = jest.fn();
64+
renderHook(() => useBottomScrollListener(onBottom, { triggerOnNoScroll: true }));
65+
expect(onBottom).toHaveBeenCalledTimes(1);
66+
});
6167
});
6268

6369
describe('given a ref it should use the given ref and', () => {

0 commit comments

Comments
 (0)