amis2/__tests__/renderers/QRCode.test.tsx

25 lines
521 B
TypeScript

import React = require('react');
import {render, fireEvent} from '@testing-library/react';
import '../../src/themes/default';
import {render as amisRender} from '../../src/index';
import {makeEnv} from '../helper';
import 'jest-canvas-mock';
test('Renderer:qr-code', () => {
const {container} = render(
amisRender(
{
type: 'page',
body: {
type: 'qr-code',
value: 'amis'
}
},
{},
makeEnv({})
)
);
expect(container).toMatchSnapshot();
});