diff --git a/components/button/__tests__/index.test.tsx b/components/button/__tests__/index.test.tsx index 406b4815ce..0f889fbc55 100644 --- a/components/button/__tests__/index.test.tsx +++ b/components/button/__tests__/index.test.tsx @@ -5,7 +5,7 @@ import { act } from 'react-dom/test-utils'; import Button from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import { fireEvent, render, sleep } from '../../../tests/utils'; +import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('Button', () => { @@ -242,6 +242,7 @@ describe('Button', () => { }); it('should support to change loading', async () => { + jest.useFakeTimers(); const { container, rerender, unmount } = render(); rerender(