Browse Source

test: Update message test case (#38766)

pull/38768/head
hms181231 2 years ago
committed by GitHub
parent
commit
f9ef37e9be
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/message/__tests__/index.test.tsx

4
components/message/__tests__/index.test.tsx

@ -1,7 +1,7 @@
import React from 'react';
import { SmileOutlined } from '@ant-design/icons';
import message, { actWrapper } from '..';
import { act, fireEvent, sleep } from '../../../tests/utils';
import { act, fireEvent, waitFakeTimer } from '../../../tests/utils';
import { awaitPromise, triggerMotionEnd } from './util';
describe('message', () => {
@ -139,7 +139,7 @@ describe('message', () => {
act(() => {
jest.advanceTimersByTime(1000);
});
await sleep(); // Wait to let event loop run
await waitFakeTimer(); // Wait to let event loop run
expect(onClose).toHaveBeenCalled();
});

Loading…
Cancel
Save