Skip to content

Commit

Permalink
write tests for triggerOnNoScroll (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinansonmez committed Nov 13, 2023
1 parent 66e5ebd commit 268ff06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/hook/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ describe('useBottomScrollListener', () => {

expect(onBottom).toHaveBeenCalledTimes(1);
});

it('shall invoke onBottom when there is no place to scroll with triggerOnNoScroll true', () => {
const onBottom = jest.fn();
renderHook(() => useBottomScrollListener(onBottom, { triggerOnNoScroll: true }));
expect(onBottom).toHaveBeenCalledTimes(1);
});
});

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

0 comments on commit 268ff06

Please sign in to comment.