amis/__tests__/renderers/Timeline.test.tsx
Dora 13846fb4e2
feat: timeline3.0 (#3072)
Co-authored-by: yanglu19 <yanglu19@baidu.com>
Co-authored-by: liaoxuezhi <liaoxuezhi@baidu.com>
2021-12-27 15:46:47 +08:00

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();
});