|
|
@ -62,11 +62,11 @@ describe('Anchor Render', () => { |
|
|
|
wrapper.instance().handleScrollTo('##API'); |
|
|
|
expect(wrapper.instance().state.activeLink).toBe('##API'); |
|
|
|
expect(scrollToSpy).not.toHaveBeenCalled(); |
|
|
|
await new Promise(resolve => setTimeout(resolve, 50)); |
|
|
|
expect(scrollToSpy).toHaveBeenCalled(); |
|
|
|
await new Promise(resolve => setTimeout(resolve, 100)); |
|
|
|
expect(wrapper.instance().animating).toBe(true); |
|
|
|
await new Promise(resolve => setTimeout(resolve, 1000)); |
|
|
|
expect(wrapper.instance().animating).toBe(false); |
|
|
|
expect(scrollToSpy).toHaveBeenCalled(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should remove listener when unmount', async () => { |
|
|
|