amis2/__tests__/renderers/Form/rating.test.tsx

34 lines
723 B
TypeScript

import React = require('react');
import {render} from '@testing-library/react';
import '../../../src/themes/default';
import {render as amisRender} from '../../../src/index';
import {makeEnv} from '../../helper';
test('Renderer:rating', async () => {
const {container} = render(
amisRender(
{
type: 'form',
api: '/api/xxx',
controls: [
{
type: 'rating',
name: 'a',
label: 'rating',
value: 3,
count: 5,
half: true,
readOnly: false
}
],
title: 'The form',
actions: []
},
{},
makeEnv({})
)
);
expect(container).toMatchSnapshot();
});