amis2/packages/amis/__tests__/renderers/BarCode.test.tsx
2022-06-02 10:00:09 +08:00

28 lines
621 B
TypeScript

import React = require('react');
import {render, fireEvent, waitFor} from '@testing-library/react';
import '../../src';
import {render as amisRender} from '../../src';
import {makeEnv, wait} from '../helper';
import 'jest-canvas-mock';
test('Renderer:bar-code', async () => {
const {container} = render(
amisRender(
{
type: 'page',
body: {
type: 'barcode',
value: 'amis'
}
},
{},
makeEnv({})
)
);
await waitFor(() =>
expect(container.querySelector('.cxd-BarCode')).toBeInTheDocument()
);
expect(container).toMatchSnapshot();
});