We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a6f7e4 commit 23aedb8Copy full SHA for 23aedb8
test/index.test.js
@@ -41,4 +41,18 @@ describe('Hello component', () => {
41
42
documentSpy.mockRestore();
43
});
44
+
45
+ it('Should use lodash.debounce when debounce is more than 0', () => {
46
+ const wrapper = shallow(<BottomScrollListener debounce={200} onBottom={() => {}} />);
47
+ const functionName = wrapper.instance().handleOnScroll.name;
48
49
+ expect(functionName).toEqual('debounced');
50
+ });
51
52
+ it('Should not use lodash.debounce when debounce is 0', () => {
53
+ const wrapper = shallow(<BottomScrollListener debounce={0} onBottom={() => {}} />);
54
55
56
+ expect(functionName).toEqual('bound handleOnScroll');
57
58
0 commit comments