feat(blocksAntd): Drawer and tests

This commit is contained in:
Gervwyk 2020-11-19 22:16:24 +02:00
parent fc04e9aa19
commit 030263efd9
4 changed files with 1737 additions and 15 deletions

View File

@ -16,22 +16,23 @@
type: Drawer
properties:
maskClosable: false
- id: "properties.width: 300px"
- id: "properties.width: 500"
type: Drawer
properties:
width: 300px
- id: "properties.height: 320px"
type: Drawer
properties:
height: 320px
- id: "properties.zIndex: 1100"
type: Drawer
properties:
zIndex: 1100
width: 500
- id: "properties.placement: top"
type: Drawer
properties:
placement: top
- id: "properties.height: 500 placement: top"
type: Drawer
properties:
placement: top
height: 500
- id: "properties.zIndex: 1100"
type: Drawer
properties:
zIndex: 1100
- id: "properties.placement: bottom"
type: Drawer
properties:

View File

@ -1,6 +1,20 @@
{
"category": "container",
"loading": false,
"test": {
"methods": [
{
"name": "toggleOpen",
"args": {}
},
{
"name": "setOpen",
"args": {
"open": true
}
}
]
},
"schema": {
"properties": {
"type": "object",

View File

@ -14,11 +14,26 @@
limitations under the License.
*/
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-tools';
import { runBlockSchemaTests, runMethodTests } from '@lowdefy/block-tools';
import Enzyme, { mount } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import { Drawer } from 'antd';
import Drawer from '../src/blocks/Drawer/Drawer';
Enzyme.configure({ adapter: new Adapter() });
import DrawerBlock from '../src/blocks/Drawer/Drawer';
import examples from '../demo/examples/Drawer.yaml';
import meta from '../src/blocks/Drawer/Drawer.json';
runRenderTests({ examples, Block: Drawer, meta });
jest.mock('antd/lib/drawer', () => {
return jest.fn((props) => props.toString());
});
const mocks = [
{
name: 'default',
fn: Drawer,
},
];
runMethodTests({ examples, Block: DrawerBlock, mocks, meta, enzyme: { mount } });
runBlockSchemaTests({ examples, meta });

File diff suppressed because it is too large Load Diff