mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
fix(blocksAntd): remove copied fields ControlledList
This commit is contained in:
parent
ceae50254c
commit
905b844d84
@ -1,38 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { runMockRenderTests } from '@lowdefy/block-tools';
|
||||
import Enzyme, { mount } from 'enzyme';
|
||||
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
|
||||
import { List } from 'antd';
|
||||
|
||||
Enzyme.configure({ adapter: new Adapter() });
|
||||
import ControlledList from '../src/blocks/ControlledList/ControlledList';
|
||||
import examples from '../demo/examples/ControlledList.yaml';
|
||||
import meta from '../src/blocks/ControlledList/ControlledList.json';
|
||||
|
||||
jest.mock('antd/lib/list', () => {
|
||||
return jest.fn(() => 'mocked');
|
||||
});
|
||||
|
||||
const mocks = [
|
||||
{
|
||||
name: 'default',
|
||||
fn: List,
|
||||
},
|
||||
];
|
||||
|
||||
runMockRenderTests({ examples, Block: ControlledList, meta, mocks, enzyme: { mount } });
|
@ -1,587 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Mock render - default - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="default_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "default",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.addItemButton: title: Add new Item - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.addItemButton: title: Add new Item_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add new Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.addItemButton: title: Add new Item",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.addToFront: true - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": false,
|
||||
"header": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="undefined_id"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"id": "properties.addToFront: true",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.hideAddButton: true - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": false,
|
||||
"header": undefined,
|
||||
"id": "properties.hideAddButton: true",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.noDataTitle: No title display - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.noDataTitle: No title display_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.noDataTitle: No title display",
|
||||
"locale": Object {
|
||||
"emptyText": "No title display",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.removeItemButton: shape: round - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.removeItemButton: shape: round_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.removeItemButton: shape: round",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.removeItemButton: shape: square - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.removeItemButton: shape: square_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.removeItemButton: shape: square",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.size: large - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.size: large_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": "large",
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.size: large",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": "large",
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.size: small - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.size: small_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": "small",
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": undefined,
|
||||
"id": "properties.size: small",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": "small",
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mock render - properties.title - value[0] - default 1`] = `
|
||||
Array [
|
||||
Array [
|
||||
Object {
|
||||
"bordered": true,
|
||||
"dataSource": Array [],
|
||||
"footer": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<br />
|
||||
<ButtonBlock
|
||||
actions={Object {}}
|
||||
blockId="properties.title_add_button"
|
||||
content={Object {}}
|
||||
list={Array []}
|
||||
menus={Array []}
|
||||
methods={
|
||||
Object {
|
||||
"callAction": [Function],
|
||||
"makeCssClass": [Function],
|
||||
"moveItemDown": [Function],
|
||||
"moveItemUp": [Function],
|
||||
"pushItem": [Function],
|
||||
"registerAction": [Function],
|
||||
"registerMethod": [Function],
|
||||
"removeItem": [Function],
|
||||
"unshiftItem": [Function],
|
||||
}
|
||||
}
|
||||
onClick={[Function]}
|
||||
properties={
|
||||
Object {
|
||||
"icon": "PlusOutlined",
|
||||
"size": undefined,
|
||||
"title": "Add Item",
|
||||
"type": "primary",
|
||||
}
|
||||
}
|
||||
required={false}
|
||||
user={Object {}}
|
||||
validation={
|
||||
Object {
|
||||
"errors": Array [],
|
||||
"status": null,
|
||||
"warnings": Array [],
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>,
|
||||
"header": <div
|
||||
className="css-dam5ev"
|
||||
>
|
||||
<Text
|
||||
strong={true}
|
||||
>
|
||||
ControlledList block
|
||||
</Text>
|
||||
</div>,
|
||||
"id": "properties.title",
|
||||
"locale": Object {
|
||||
"emptyText": "No Items",
|
||||
},
|
||||
"renderItem": [Function],
|
||||
"size": undefined,
|
||||
},
|
||||
Object {},
|
||||
],
|
||||
]
|
||||
`;
|
Loading…
Reference in New Issue
Block a user