mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
chore: 更新 nav 单测延迟的判断逻辑 (#6149)
This commit is contained in:
parent
715b922564
commit
dc2b670708
@ -10,7 +10,7 @@
|
||||
* 7. 更多操作
|
||||
*/
|
||||
|
||||
import {render, cleanup, fireEvent} from '@testing-library/react';
|
||||
import {render, cleanup, fireEvent, waitFor} from '@testing-library/react';
|
||||
import '../../src';
|
||||
import {render as amisRender} from '../../src';
|
||||
import {makeEnv, wait} from '../helper';
|
||||
@ -277,7 +277,9 @@ test('Renderer:Nav with overflow', async () => {
|
||||
|
||||
fireEvent.click(btn!);
|
||||
|
||||
await wait(200);
|
||||
await waitFor(() =>
|
||||
expect(container.querySelector('.cxd-Spinner')).not.toBeInTheDocument()
|
||||
);
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@ -509,7 +511,9 @@ test('Renderer:Nav with itemActions', async () => {
|
||||
container.querySelector('.cxd-Nav-Menu-item-extra .cxd-Button')!
|
||||
);
|
||||
|
||||
await wait(200);
|
||||
await waitFor(() =>
|
||||
expect(container.querySelector('.cxd-Spinner')).not.toBeInTheDocument()
|
||||
);
|
||||
expect(container).toMatchSnapshot();
|
||||
expect(getByText('编辑')).toBeInTheDocument();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user