test: Fix resize related test case

This commit is contained in:
zombiej 2020-08-18 16:46:05 +08:00
parent adf990f8fb
commit aec0f4517c
2 changed files with 3 additions and 1 deletions

View File

@ -115,6 +115,7 @@ describe('TextArea', () => {
},
},
]);
await Promise.resolve();
expect(onResize).toHaveBeenCalledWith(
expect.objectContaining({

View File

@ -112,9 +112,10 @@ describe('PageHeader', () => {
expect(render(wrapper)).toMatchSnapshot();
});
it('change container width', () => {
it('change container width', async () => {
const wrapper = mount(<PageHeader title="Page Title" extra="extra" />);
wrapper.triggerResize();
await Promise.resolve();
wrapper.update();
expect(wrapper.find('.ant-page-header').hasClass('ant-page-header-compact')).toBe(true);
});