From 268ff06f34e38bf31677d083eb3df83c33c08035 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" <37421564+sinansonmez@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:07:08 +0100 Subject: [PATCH] write tests for triggerOnNoScroll (#69) --- src/hook/index.test.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hook/index.test.tsx b/src/hook/index.test.tsx index 8c7b838..67d5ee1 100644 --- a/src/hook/index.test.tsx +++ b/src/hook/index.test.tsx @@ -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', () => {