mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 04:59:17 +08:00
28 lines
621 B
TypeScript
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();
|
|
});
|