mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
97 lines
1.9 KiB
TypeScript
97 lines
1.9 KiB
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:breadcrumb', () => {
|
|
const {container} = render(
|
|
amisRender(
|
|
{
|
|
type: 'breadcrumb',
|
|
items: [
|
|
{
|
|
label: '首页',
|
|
href: 'https://baidu.gitee.com/',
|
|
icon: 'fa fa-home'
|
|
},
|
|
{
|
|
label: '上级页面'
|
|
},
|
|
{
|
|
label: '<b>当前页面</b>'
|
|
}
|
|
]
|
|
},
|
|
{},
|
|
makeEnv({})
|
|
)
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
|
|
test('Renderer:breadcrumb var', () => {
|
|
const {container} = render(
|
|
amisRender(
|
|
{
|
|
type: 'page',
|
|
data: {
|
|
breadcrumb: [
|
|
{
|
|
label: '首页',
|
|
href: 'https://baidu.gitee.com/'
|
|
},
|
|
{
|
|
label: '上级页面'
|
|
},
|
|
{
|
|
label: '<b>当前页面</b>'
|
|
}
|
|
]
|
|
},
|
|
body: {
|
|
type: 'breadcrumb',
|
|
source: '${breadcrumb}'
|
|
}
|
|
},
|
|
{},
|
|
makeEnv({})
|
|
)
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
|
|
test('Renderer:breadcrumb separator', () => {
|
|
const {container} = render(
|
|
amisRender(
|
|
{
|
|
type: 'page',
|
|
body: {
|
|
type: 'breadcrumb',
|
|
separator: '>',
|
|
separatorClassName: 'text-black',
|
|
items: [
|
|
{
|
|
label: '首页',
|
|
href: 'https://baidu.gitee.com/',
|
|
icon: 'fa fa-home'
|
|
},
|
|
{
|
|
label: '上级页面'
|
|
},
|
|
{
|
|
label: '<b>当前页面</b>'
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{},
|
|
makeEnv({})
|
|
)
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|