mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-06 14:09:20 +08:00
34 lines
723 B
TypeScript
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();
|
|
});
|