mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:28:37 +08:00
35 lines
888 B
TypeScript
35 lines
888 B
TypeScript
|
import React = require('react');
|
||
|
import {render, cleanup, fireEvent} from 'react-testing-library';
|
||
|
import '../../../src/themes/default';
|
||
|
import {
|
||
|
render as amisRender
|
||
|
} from '../../../src/index';
|
||
|
import {makeEnv} from '../../helper';
|
||
|
import { clearStoresCache } from '../../../src/factory';
|
||
|
|
||
|
afterEach(() => {
|
||
|
cleanup();
|
||
|
clearStoresCache();
|
||
|
});
|
||
|
|
||
|
test('Renderer:checkbox', async () => {
|
||
|
const {
|
||
|
container
|
||
|
} = render(amisRender({
|
||
|
type: 'form',
|
||
|
title: 'The form',
|
||
|
controls: [
|
||
|
{
|
||
|
name: 'checkbox',
|
||
|
type: 'checkbox',
|
||
|
label: 'Checkbox',
|
||
|
option: '选项说明',
|
||
|
trueValue: true,
|
||
|
falseValue: false
|
||
|
}
|
||
|
],
|
||
|
submitText: null,
|
||
|
actions: []
|
||
|
}, {}, makeEnv()));
|
||
|
expect(container).toMatchSnapshot();
|
||
|
});
|