amis2/packages/amis/__tests__/renderers/Form/hbox.test.tsx

50 lines
1.1 KiB
TypeScript
Raw Normal View History

import React = require('react');
import {render, cleanup} from '@testing-library/react';
2022-06-02 10:00:09 +08:00
import '../../../src';
import {render as amisRender} from '../../../src';
import {makeEnv} from '../../helper';
2022-06-02 13:28:23 +08:00
import {clearStoresCache} from '../../../src';
afterEach(() => {
cleanup();
clearStoresCache();
});
test('Renderer:hbox', async () => {
const {container} = render(
amisRender(
{
type: 'form',
title: 'The form',
controls: [
{
type: 'hbox',
columns: [
{
columnClassName: 'w-sm',
controls: [
{
name: 'text',
type: 'text',
label: false,
placeholder: 'Text'
}
]
},
{
type: 'tpl',
tpl: '其他类型的渲染器'
}
]
}
],
submitText: null,
actions: []
},
{},
makeEnv()
)
);
expect(container).toMatchSnapshot();
});