mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
feat(blocksAntd): Drawer and tests
This commit is contained in:
parent
fc04e9aa19
commit
030263efd9
@ -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:
|
||||
|
@ -1,6 +1,20 @@
|
||||
{
|
||||
"category": "container",
|
||||
"loading": false,
|
||||
"test": {
|
||||
"methods": [
|
||||
{
|
||||
"name": "toggleOpen",
|
||||
"args": {}
|
||||
},
|
||||
{
|
||||
"name": "setOpen",
|
||||
"args": {
|
||||
"open": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"schema": {
|
||||
"properties": {
|
||||
"type": "object",
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user