mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-16 19:58:12 +00:00
63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
import '../fixtures/window';
|
|
import { Node, Designer, getConvertedExtraKey } from '@ali/lowcode-designer';
|
|
import { Editor, globalContext } from '@ali/lowcode-editor-core';
|
|
import { removeEmptyPropsReducer } from '../../src/props-reducers/remove-empty-prop-reducer';
|
|
import formSchema from '../fixtures/schema/form';
|
|
|
|
it('removeEmptyPropsReducer 测试', () => {
|
|
const newProps = removeEmptyPropsReducer(
|
|
{
|
|
propA: '111',
|
|
dataSource: {
|
|
online: [
|
|
{
|
|
options: {
|
|
params: [
|
|
{
|
|
name: 'propA',
|
|
value: '111',
|
|
},
|
|
{
|
|
value: '111',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
isRoot() {
|
|
return true;
|
|
},
|
|
},
|
|
);
|
|
|
|
expect(newProps).toEqual({
|
|
propA: '111',
|
|
dataSource: {
|
|
online: [
|
|
{
|
|
options: {
|
|
params: [{
|
|
name: 'propA',
|
|
value: '111',
|
|
}, {
|
|
value: '111',
|
|
}],
|
|
},
|
|
},
|
|
],
|
|
list: [
|
|
{
|
|
options: {
|
|
params: {
|
|
propA: '111',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
});
|