mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
955ad22b5d
* crud 可以直接配置 perPage 的值,而不需要在 defaultParams 中配置 * 补充 crud 属性表 * 顺带更新一下 snapshot * 还有部分用例受时区影响 * test 设置 timezone * test 设置 timezone * 只更新需要一定的延时
34 lines
819 B
TypeScript
34 lines
819 B
TypeScript
import React = require('react');
|
|
import {render} from 'react-testing-library';
|
|
import '../../src/themes/default';
|
|
import {render as amisRender} from '../../src/index';
|
|
import {makeEnv} from '../helper';
|
|
import moment from 'moment';
|
|
|
|
test('Renderer:date', async () => {
|
|
const {container} = render(
|
|
amisRender(
|
|
{
|
|
type: 'date',
|
|
name: 'date',
|
|
label: 'date',
|
|
value: '1559836800',
|
|
format: 'YYYY-MM-DD',
|
|
placeholder: '请选择时间',
|
|
minDate: '1559664000',
|
|
maxDate: '1561737600',
|
|
className: 'show'
|
|
},
|
|
{},
|
|
makeEnv({})
|
|
)
|
|
);
|
|
|
|
const input = container.querySelector('.a-DateField');
|
|
expect(input?.innerHTML).toEqual(
|
|
moment('1559836800', 'X').format('YYYY-MM-DD')
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|