mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-10 17:02:18 +08:00
13846fb4e2
Co-authored-by: yanglu19 <yanglu19@baidu.com> Co-authored-by: liaoxuezhi <liaoxuezhi@baidu.com>
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import React = require('react');
|
|
import {render, cleanup} from '@testing-library/react';
|
|
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:timeline', async () => {
|
|
const {container} = render(
|
|
amisRender(
|
|
{
|
|
type: 'timeline',
|
|
items: [
|
|
{
|
|
time: "2019-02-07",
|
|
title: "节点数据",
|
|
color: "#ffb200",
|
|
},
|
|
{
|
|
time: "2019-02-08",
|
|
title: "节点数据",
|
|
color: "#4F86F4",
|
|
},
|
|
{
|
|
time: "2019-02-09",
|
|
title: "节点数据",
|
|
color: "success",
|
|
},
|
|
{
|
|
time: "2019-02-09",
|
|
title: "节点数据",
|
|
color: "warning",
|
|
}
|
|
]
|
|
},
|
|
{},
|
|
makeEnv()
|
|
)
|
|
);
|
|
expect(container).toMatchSnapshot();
|
|
});
|