mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix anchor test fails a lot again
This commit is contained in:
parent
0e2c58e42e
commit
fbab93fbd6
@ -62,11 +62,11 @@ describe('Anchor Render', () => {
|
|||||||
wrapper.instance().handleScrollTo('##API');
|
wrapper.instance().handleScrollTo('##API');
|
||||||
expect(wrapper.instance().state.activeLink).toBe('##API');
|
expect(wrapper.instance().state.activeLink).toBe('##API');
|
||||||
expect(scrollToSpy).not.toHaveBeenCalled();
|
expect(scrollToSpy).not.toHaveBeenCalled();
|
||||||
await new Promise(resolve => setTimeout(resolve, 50));
|
await new Promise(resolve => setTimeout(resolve, 100));
|
||||||
expect(scrollToSpy).toHaveBeenCalled();
|
|
||||||
expect(wrapper.instance().animating).toBe(true);
|
expect(wrapper.instance().animating).toBe(true);
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
expect(wrapper.instance().animating).toBe(false);
|
expect(wrapper.instance().animating).toBe(false);
|
||||||
|
expect(scrollToSpy).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove listener when unmount', async () => {
|
it('should remove listener when unmount', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user