2022-02-10 20:15:39 +08:00
|
|
|
import React = require('react');
|
|
|
|
import {render} from '@testing-library/react';
|
2022-06-02 10:00:09 +08:00
|
|
|
import '../../src';
|
|
|
|
import {render as amisRender} from '../../src';
|
2022-02-10 20:15:39 +08:00
|
|
|
import {makeEnv} from '../helper';
|
|
|
|
|
|
|
|
test('Renderer:anchorNav', () => {
|
|
|
|
const {container} = render(
|
|
|
|
amisRender(
|
|
|
|
{
|
|
|
|
type: 'page',
|
|
|
|
body: {
|
|
|
|
type: 'anchor-nav',
|
|
|
|
links: [
|
|
|
|
{
|
|
|
|
title: '基本信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'form',
|
|
|
|
title: '基本信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'input-text',
|
|
|
|
name: 'name',
|
|
|
|
label: '姓名:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'email',
|
|
|
|
type: 'input-email',
|
|
|
|
label: '邮箱:'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '工作信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'form',
|
|
|
|
title: '工作信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'input-text',
|
|
|
|
name: 'cname',
|
|
|
|
label: '公司名称:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'caddress',
|
|
|
|
type: 'input-text',
|
|
|
|
label: '公司地址:'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{},
|
|
|
|
makeEnv({})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Renderer:anchorNav horizontal', () => {
|
|
|
|
const {container} = render(
|
|
|
|
amisRender(
|
|
|
|
{
|
|
|
|
type: 'page',
|
|
|
|
body: {
|
|
|
|
type: 'anchor-nav',
|
|
|
|
direction: 'horizontal',
|
|
|
|
links: [
|
|
|
|
{
|
|
|
|
title: '基本信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'form',
|
|
|
|
title: '基本信息',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
type: 'input-text',
|
|
|
|
name: 'name',
|
|
|
|
label: '姓名:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'email',
|
|
|
|
type: 'input-email',
|
|
|
|
label: '邮箱:'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{},
|
|
|
|
makeEnv({})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|