chore: 修几个单元测试报错 (#4272)

This commit is contained in:
吴多益 2022-05-10 13:54:18 +08:00 committed by GitHub
parent a4b475b8ea
commit f12754554f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -205,10 +205,6 @@ test('Renderers:Action countDown', async () => {
let button = container.querySelector('button');
fireEvent.click(button as HTMLButtonElement);
button = container.querySelector('button');
expect(button).toBeNull();
await waitFor(() => {
expect(container.querySelector('button')).not.toBeInTheDocument();
});

View File

@ -6,7 +6,7 @@ import {makeEnv, wait} from '../helper';
import 'jest-canvas-mock';
test('Renderer:bar-code', async () => {
const {container, getByTestId} = render(
const {container} = render(
amisRender(
{
type: 'page',
@ -19,7 +19,9 @@ test('Renderer:bar-code', async () => {
makeEnv({})
)
);
await waitFor(() => expect(getByTestId('barcode')).toBeInTheDocument());
await waitFor(() =>
expect(container.querySelector('.cxd-BarCode')).toBeInTheDocument()
);
expect(container).toMatchSnapshot();
});