mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
test: Update page-header test case (#38286)
This commit is contained in:
parent
e939b43af4
commit
37fb68ab68
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { act, fireEvent, render, sleep, triggerResize } from '../../../tests/utils';
|
||||
import { fireEvent, render, waitFakeTimer, triggerResize } from '../../../tests/utils';
|
||||
import PageHeader from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
@ -121,10 +121,7 @@ describe('PageHeader', () => {
|
||||
jest.useFakeTimers();
|
||||
const { container } = render(<PageHeader title="Page Title" extra="extra" />);
|
||||
triggerResize(container.firstChild as HTMLDivElement);
|
||||
await act(async () => {
|
||||
await jest.runAllTimers();
|
||||
await sleep();
|
||||
});
|
||||
await waitFakeTimer();
|
||||
expect(container.querySelector('div.ant-page-header')).toHaveClass('ant-page-header-compact');
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user