Merge pull request #1079 from lowdefy/plugin-tests

fix: Plugin tests updated to use new block config.
This commit is contained in:
Gerrie van Wyk 2022-02-01 14:09:21 +02:00 committed by GitHub
commit b05fe5e3ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
173 changed files with 12369 additions and 1917 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/test'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest', { configFile: '../../../.swcrc.test' }],
'^.+\\.(t|j)sx?$': ['@swc/jest', { configFile: '../../../../.swcrc.test' }],
'\\.yaml$': 'jest-transform-yaml',
},
snapshotSerializers: ['@emotion/jest/serializer', 'jest-serializer-html'],

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Affix.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Affix: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Affix.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Alert.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Alert: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Alert.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './AutoComplete.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './AutoComplete.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Avatar.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Avatar: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Avatar.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Badge.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Badge: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Badge.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Breadcrumb.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -44,4 +48,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Breadcrumb.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Button.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Button: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Button.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -18,10 +18,14 @@ import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import examples from './examples.yaml';
import block from './index.js';
import Block from './ButtonSelector.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -48,4 +52,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './ButtonSelector.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Card.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Card: jest.fn(() => 'mocked'),
@ -40,4 +44,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Card.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row, Space } from 'antd';
import block from './index.js';
import Block from './CheckboxSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -48,4 +52,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './CheckboxSelector.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row, Space } from 'antd';
import block from './index.js';
import Block from './CheckboxSwitch.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -48,4 +52,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,18 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './CheckboxSwitch.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// values: [true],
// }
const testConfig = {
validation: true,
required: true,
values: [true],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Collapse.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd/lib/collapse', () => {
const collapse = jest.fn(() => 'mocked');
@ -50,4 +54,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Collapse.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Avatar } from 'antd';
import block from './index.js';
import Block from './Comment.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -45,4 +49,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Comment.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './ConfirmModal.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -54,4 +58,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,44 +16,45 @@
import { runBlockSchemaTests, runMockMethodTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './ConfirmModal.js';
import examples from './examples.yaml';
import schema from './schema.json';
// tests: {
// methods: [
// {
// name: 'open',
// args: {},
// },
// {
// name: 'open',
// args: {
// status: 'warning',
// },
// },
// {
// name: 'open',
// args: {
// message: 'Args message',
// },
// },
// {
// name: 'open',
// args: {
// description: 'Args description',
// },
// },
// {
// name: 'open',
// args: {
// duration: 1,
// },
// },
// ],
// }
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'open',
args: {},
},
{
name: 'open',
args: {
status: 'warning',
},
},
{
name: 'open',
args: {
message: 'Args message',
},
},
{
name: 'open',
args: {
description: 'Args description',
},
},
{
name: 'open',
args: {
duration: 1,
},
},
],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -87,5 +88,5 @@ const mocks = [
},
];
runMockMethodTests({ examples, mocks, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runMockMethodTests({ Block, examples, mocks, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Content.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -44,4 +48,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,11 +17,14 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Content.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Typography, Button } from 'antd';
import block from './index.js';
import Block from './ControlledList.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './ControlledList.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// tests: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './DateRangeSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './DateRangeSelector.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ validationsExamples, testConfig, schema, examples, Block });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './DateSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,17 +17,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './DateSelector.js';
import block from './index.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './DateTimeSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -45,4 +49,4 @@ const mocks = [
name: 'DateTimeSelector',
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -19,15 +19,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import validationsExamples from '../../validationExamples.js';
import Block from './DateTimeSelector.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Descriptions.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -44,4 +48,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Descriptions.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Divider.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Divider.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Drawer.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -17,25 +17,26 @@
import { runBlockSchemaTests, runMockMethodTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Drawer.js';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleOpen',
// args: {},
// },
// {
// name: 'setOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleOpen',
args: {},
},
{
name: 'setOpen',
args: {
open: true,
},
},
],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -58,5 +59,5 @@ const mocks = [
},
];
runMockMethodTests({ examples, mocks, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runMockMethodTests({ Block, examples, mocks, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Footer.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -44,4 +48,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Footer.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Header.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -44,4 +48,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import examples from './examples.yaml';
import Block from './Header.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Label.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => ({
Row: jest.fn(() => 'mocked'),
@ -41,4 +45,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Label.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Layout.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Layout.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Menu.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Menu.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './Message.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -55,4 +59,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,39 +16,39 @@
import { runBlockSchemaTests, runMockMethodTests } from '@lowdefy/block-dev';
import block from './index.js';
import examples from './examples.yaml';
import Block from './Message.js';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'open',
// args: {},
// },
// {
// name: 'open',
// args: {
// status: 'warning',
// },
// },
// {
// name: 'open',
// args: {
// content: 'Args message content',
// },
// },
// {
// name: 'open',
// args: {
// duration: 1,
// },
// },
// ],
// }
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'open',
args: {},
},
{
name: 'open',
args: {
status: 'warning',
},
},
{
name: 'open',
args: {
content: 'Args message content',
},
},
{
name: 'open',
args: {
duration: 1,
},
},
],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -83,5 +83,5 @@ const mocks = [
},
];
runMockMethodTests({ examples, Block, meta, mocks, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runMockMethodTests({ Block, examples, mocks, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,10 +17,14 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import examples from './examples.yaml';
import block from './index.js';
import Block from './MobileMenu.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
return {
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,25 +18,25 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './MobileMenu.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleOpen',
// args: {},
// },
// {
// name: 'setOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleOpen',
args: {},
},
{
name: 'setOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ Block, examples, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Modal.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -54,4 +58,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -19,25 +19,25 @@ import { Modal } from 'antd';
import Block from './Modal.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleOpen',
// args: {},
// },
// {
// name: 'setOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleOpen',
args: {},
},
{
name: 'setOpen',
args: {
open: true,
},
},
],
};
jest.mock('antd/lib/modal', () => {
return jest.fn(() => 'mocked');
@ -50,5 +50,5 @@ const mocks = [
},
];
runMockMethodTests({ examples, Block, mocks, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runMockMethodTests({ Block, examples, mocks, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -18,10 +18,14 @@ import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import examples from './examples.yaml';
import block from './index.js';
import Block from './MonthSelector.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './MonthSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './MultipleSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './MultipleSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Notification.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -53,4 +57,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,44 +16,45 @@
import { runBlockSchemaTests, runMockMethodTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Notification.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'open',
// args: {},
// },
// {
// name: 'open',
// args: {
// status: 'warning',
// },
// },
// {
// name: 'open',
// args: {
// message: 'Args message',
// },
// },
// {
// name: 'open',
// args: {
// description: 'Args description',
// },
// },
// {
// name: 'open',
// args: {
// duration: 1,
// },
// },
// ],
// }
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'open',
args: {},
},
{
name: 'open',
args: {
status: 'warning',
},
},
{
name: 'open',
args: {
message: 'Args message',
},
},
{
name: 'open',
args: {
description: 'Args description',
},
},
{
name: 'open',
args: {
duration: 1,
},
},
],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -86,5 +87,5 @@ const mocks = [
},
];
runMockMethodTests({ examples, meta, mocks, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runMockMethodTests({ Block, examples, mocks, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './NumberInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './NumberInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHCSF.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,27 +16,27 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHCSF.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleSiderOpen',
// args: {},
// },
// {
// name: 'setSiderOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleSiderOpen',
args: {},
},
{
name: 'setSiderOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHSCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -46,4 +50,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,27 +16,27 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHSCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleSiderOpen',
// args: {},
// },
// {
// name: 'setSiderOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleSiderOpen',
args: {},
},
{
name: 'setSiderOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Affix, Breadcrumb, Button } from 'antd';
import block from './index.js';
import Block from './PageHeaderMenu.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -50,4 +54,4 @@ const mocks = [
name: 'PageHeaderMenu',
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,27 +16,27 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageHeaderMenu.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleOpen',
// args: {},
// },
// {
// name: 'setOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleOpen',
args: {},
},
{
name: 'setOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageSHCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -45,4 +49,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,27 +16,27 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageSHCF.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleSiderOpen',
// args: {},
// },
// {
// name: 'setSiderOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleSiderOpen',
args: {},
},
{
name: 'setSiderOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Affix, Breadcrumb, Button } from 'antd';
import block from './index.js';
import Block from './PageSiderMenu.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -50,4 +54,4 @@ const mocks = [
name: 'PageSiderMenu',
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,37 +16,37 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PageSiderMenu.js';
import examples from './examples.yaml';
import schema from './schema.json';
// test: {
// methods: [
// {
// name: 'toggleMobileMenuOpen',
// args: {},
// },
// {
// name: 'setMobileMenuOpen',
// args: {
// open: true,
// },
// },
// {
// name: 'toggleSiderOpen',
// args: {},
// },
// {
// name: 'setSiderOpen',
// args: {
// open: true,
// },
// },
// ],
// }
const testConfig = {
validation: true,
required: true,
values: [],
methods: [
{
name: 'toggleMobileMenuOpen',
args: {},
},
{
name: 'setMobileMenuOpen',
args: {
open: true,
},
},
{
name: 'toggleSiderOpen',
args: {},
},
{
name: 'setSiderOpen',
args: {
open: true,
},
},
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Pagination.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Pagination.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Paragraph.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -42,4 +46,4 @@ const mocks = [
name: 'Paragraph',
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Paragraph.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,17 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './ParagraphInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
required: true,
validation: true,
values: [
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -42,4 +48,4 @@ const mocks = [
name: 'ParagraphInput',
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,21 +16,18 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './ParagraphInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// values: [
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
// ],
// }
const testConfig = {
required: true,
validation: true,
values: [
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -1,836 +1,77 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Mock render - default - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "default",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
<div
class="ant-typography {}"
id="default"
>
<div
aria-label="Edit"
class="ant-typography-edit"
role="button"
style="border: 0px; background: transparent; padding: 0px; line-height: inherit; display: inline-block;"
tabindex="0"
>
<span
aria-label="edit"
class="anticon anticon-edit"
role="button"
>
<svg
aria-hidden="true"
data-icon="edit"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"
/>
</svg>
</span>
</div>
</div>
`;
exports[`Mock render - properties.code: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": true,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.code: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
exports[`Mock render - default - value[0] - ParagraphInput 2`] = `Array []`;
exports[`Mock render - default - value[1] - ParagraphInput 1`] = `
<div
class="ant-typography {}"
id="default"
>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<div
aria-label="Edit"
class="ant-typography-edit"
role="button"
style="border: 0px; background: transparent; padding: 0px; line-height: inherit; display: inline-block;"
tabindex="0"
>
<span
aria-label="edit"
class="anticon anticon-edit"
role="button"
>
<svg
aria-hidden="true"
data-icon="edit"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"
/>
</svg>
</span>
</div>
</div>
`;
exports[`Mock render - properties.copyable: icon - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": Object {
"icon": <IconComp1
basePath=""
blockId="properties.copyable: icon_copyable_icon"
components={Object {}}
content={Object {}}
events={Object {}}
list={Array []}
menus={Array []}
methods={
Object {
"makeCssClass": [Function],
"registerEvent": [Function],
"registerMethod": [Function],
"triggerEvent": [Function],
}
}
properties="WarningOutlined"
required={false}
user={Object {}}
validation={
Object {
"errors": Array [],
"status": null,
"warnings": Array [],
}
}
/>,
"onCopy": [Function],
"text": null,
"tooltips": undefined,
},
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.copyable: icon",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.copyable: icon: [] - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": Object {
"icon": Array [
<IconComp1
basePath=""
blockId="properties.copyable: icon: []_copyable_before_icon"
components={Object {}}
content={Object {}}
events={Object {}}
list={Array []}
menus={Array []}
methods={
Object {
"makeCssClass": [Function],
"registerEvent": [Function],
"registerMethod": [Function],
"triggerEvent": [Function],
}
}
properties="WarningOutlined"
required={false}
user={Object {}}
validation={
Object {
"errors": Array [],
"status": null,
"warnings": Array [],
}
}
/>,
<IconComp1
basePath=""
blockId="properties.copyable: icon: []_copyable_after_icon"
components={Object {}}
content={Object {}}
events={Object {}}
list={Array []}
menus={Array []}
methods={
Object {
"makeCssClass": [Function],
"registerEvent": [Function],
"registerMethod": [Function],
"triggerEvent": [Function],
}
}
properties="RocketOutlined"
required={false}
user={Object {}}
validation={
Object {
"errors": Array [],
"status": null,
"warnings": Array [],
}
}
/>,
],
"onCopy": [Function],
"text": null,
"tooltips": undefined,
},
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.copyable: icon: []",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.copyable: text: one - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": Object {
"icon": undefined,
"onCopy": [Function],
"text": "one",
"tooltips": undefined,
},
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.copyable: text: one",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.copyable: tooltips: [] - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": Object {
"icon": undefined,
"onCopy": [Function],
"text": null,
"tooltips": Array [
"Click to copy",
"Copy done",
],
},
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.copyable: tooltips: []",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.copyable: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": true,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.copyable: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.delete: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": true,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.delete: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.disabled: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": true,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.disabled: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.editable.icon - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"autoSize": undefined,
"editing": false,
"icon": <IconComp1
basePath=""
blockId="properties.editable.icon_editable_icon"
components={Object {}}
content={Object {}}
events={Object {}}
list={Array []}
menus={Array []}
methods={
Object {
"makeCssClass": [Function],
"registerEvent": [Function],
"registerMethod": [Function],
"triggerEvent": [Function],
}
}
properties="PlusOutlined"
required={false}
user={Object {}}
validation={
Object {
"errors": Array [],
"status": null,
"warnings": Array [],
}
}
/>,
"maxLength": undefined,
"onChange": [Function],
"onStart": [Function],
"tooltip": undefined,
},
"ellipsis": undefined,
"id": "properties.editable.icon",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.editable.maxLength: 10 - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"autoSize": undefined,
"editing": false,
"icon": undefined,
"maxLength": 10,
"onChange": [Function],
"onStart": [Function],
"tooltip": undefined,
},
"ellipsis": undefined,
"id": "properties.editable.maxLength: 10",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.editable.tooltip - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"autoSize": undefined,
"editing": false,
"icon": undefined,
"maxLength": undefined,
"onChange": [Function],
"onStart": [Function],
"tooltip": "Change the value",
},
"ellipsis": undefined,
"id": "properties.editable.tooltip",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.editable: false - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": false,
"ellipsis": undefined,
"id": "properties.editable: false",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.editable: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.editable: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.ellipsis: expandable, rows - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": Object {
"expandable": true,
"onEllipsis": [Function],
"onExpand": [Function],
"rows": 3,
"suffix": undefined,
},
"id": "properties.ellipsis: expandable, rows",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.ellipsis: rows - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": Object {
"expandable": undefined,
"onEllipsis": [Function],
"onExpand": [Function],
"rows": 3,
"suffix": undefined,
},
"id": "properties.ellipsis: rows",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.ellipsis: rows, suffix - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": Object {
"expandable": undefined,
"onEllipsis": [Function],
"onExpand": [Function],
"rows": 3,
"suffix": "and other",
},
"id": "properties.ellipsis: rows, suffix",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.ellipsis: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": true,
"id": "properties.ellipsis: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.italic: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.italic: true",
"italic": true,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.mark: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.mark: true",
"italic": undefined,
"mark": true,
"strong": undefined,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.strong: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.strong: true",
"italic": undefined,
"mark": undefined,
"strong": true,
"type": undefined,
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.type: danger - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.type: danger",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": "danger",
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.type: secondary - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.type: secondary",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": "secondary",
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.type: warning - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.type: warning",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": "warning",
"underline": undefined,
},
Object {},
],
]
`;
exports[`Mock render - properties.underline: true - value[0] - ParagraphInput 1`] = `
Array [
Array [
Object {
"children": "",
"className": "{}",
"code": undefined,
"copyable": undefined,
"delete": undefined,
"disabled": undefined,
"editable": Object {
"onChange": [Function],
"onStart": [Function],
},
"ellipsis": undefined,
"id": "properties.underline: true",
"italic": undefined,
"mark": undefined,
"strong": undefined,
"type": undefined,
"underline": true,
},
Object {},
],
]
`;
exports[`Mock render - default - value[1] - ParagraphInput 2`] = `Array []`;

View File

@ -14,150 +14,150 @@
- id: default
type: ParagraphInput
- id: 'properties.code: true'
type: ParagraphInput
properties:
code: true
- id: 'properties.delete: true'
type: ParagraphInput
properties:
delete: true
- id: 'properties.disabled: true'
type: ParagraphInput
properties:
disabled: true
- id: 'properties.mark: true'
type: ParagraphInput
properties:
mark: true
- id: 'properties.strong: true'
type: ParagraphInput
properties:
strong: true
- id: 'properties.italic: true'
type: ParagraphInput
properties:
italic: true
- id: 'properties.underline: true'
type: ParagraphInput
properties:
underline: true
- id: 'properties.type: secondary'
type: ParagraphInput
properties:
type: secondary
- id: 'properties.type: warning'
type: ParagraphInput
properties:
type: warning
- id: 'properties.type: danger'
type: ParagraphInput
properties:
type: danger
- id: 'properties.copyable: true'
type: ParagraphInput
properties:
copyable: true
- id: 'properties.copyable: text: one'
type: ParagraphInput
properties:
copyable:
text: one
- id: 'properties.copyable: icon'
type: ParagraphInput
properties:
copyable:
icon: WarningOutlined
- id: 'properties.copyable: icon: []'
type: ParagraphInput
properties:
copyable:
icon:
- WarningOutlined
- RocketOutlined
- id: 'properties.copyable: tooltips: []'
type: ParagraphInput
properties:
copyable:
tooltips:
- Click to copy
- Copy done
- id: 'properties.ellipsis: true'
type: ParagraphInput
style:
width: 300
properties:
ellipsis: true
- id: 'properties.ellipsis: rows'
type: ParagraphInput
style:
width: 300
properties:
ellipsis:
rows: 3
- id: 'properties.ellipsis: expandable, rows'
type: ParagraphInput
style:
width: 300
properties:
ellipsis:
rows: 3
expandable: true
- id: 'properties.ellipsis: rows, suffix'
type: ParagraphInput
style:
width: 300
properties:
ellipsis:
rows: 3
suffix: and other
# FIX Jest: not working, might be and antd issue.
# - id: 'properties.ellipsis: rows, symbol'
# - id: 'properties.code: true'
# type: ParagraphInput
# properties:
# code: true
# - id: 'properties.delete: true'
# type: ParagraphInput
# properties:
# delete: true
# - id: 'properties.disabled: true'
# type: ParagraphInput
# properties:
# disabled: true
# - id: 'properties.mark: true'
# type: ParagraphInput
# properties:
# mark: true
# - id: 'properties.strong: true'
# type: ParagraphInput
# properties:
# strong: true
# - id: 'properties.italic: true'
# type: ParagraphInput
# properties:
# italic: true
# - id: 'properties.underline: true'
# type: ParagraphInput
# properties:
# underline: true
# - id: 'properties.type: secondary'
# type: ParagraphInput
# properties:
# type: secondary
# - id: 'properties.type: warning'
# type: ParagraphInput
# properties:
# type: warning
# - id: 'properties.type: danger'
# type: ParagraphInput
# properties:
# type: danger
# - id: 'properties.copyable: true'
# type: ParagraphInput
# properties:
# copyable: true
# - id: 'properties.copyable: text: one'
# type: ParagraphInput
# properties:
# copyable:
# text: one
# - id: 'properties.copyable: icon'
# type: ParagraphInput
# properties:
# copyable:
# icon: WarningOutlined
# - id: 'properties.copyable: icon: []'
# type: ParagraphInput
# properties:
# copyable:
# icon:
# - WarningOutlined
# - RocketOutlined
# - id: 'properties.copyable: tooltips: []'
# type: ParagraphInput
# properties:
# copyable:
# tooltips:
# - Click to copy
# - Copy done
# - id: 'properties.ellipsis: true'
# type: ParagraphInput
# style:
# width: 300
# properties:
# ellipsis: true
# - id: 'properties.ellipsis: rows'
# type: ParagraphInput
# style:
# width: 300
# properties:
# ellipsis:
# symbol: '???'
# rows: 3
# - id: 'properties.ellipsis: expandable, rows'
# type: ParagraphInput
# style:
# width: 300
# properties:
# ellipsis:
# rows: 3
# expandable: true
# - id: 'properties.ellipsis: rows, suffix'
# type: ParagraphInput
# style:
# width: 300
# properties:
# ellipsis:
# rows: 3
# suffix: and other
# # FIX Jest: not working, might be and antd issue.
# # - id: 'properties.ellipsis: rows, symbol'
# # type: ParagraphInput
# # style:
# # width: 300
# # properties:
# # ellipsis:
# # symbol: '???'
- id: 'properties.editable: true'
type: ParagraphInput
properties:
editable: true
- id: 'properties.editable: false'
type: ParagraphInput
properties:
editable: false
- id: 'properties.editable.icon'
type: ParagraphInput
properties:
editable:
icon: PlusOutlined
- id: 'properties.editable.tooltip'
type: ParagraphInput
properties:
editable:
tooltip: Change the value
# FIX: TypeError: Cannot read property 'focus' of null
# - id: 'properties.editable.editing: true'
# - id: 'properties.editable: true'
# type: ParagraphInput
# properties:
# editable: true
# - id: 'properties.editable: false'
# type: ParagraphInput
# properties:
# editable: false
# - id: 'properties.editable.icon'
# type: ParagraphInput
# properties:
# editable:
# editing: true
- id: 'properties.editable.maxLength: 10'
type: ParagraphInput
properties:
editable:
maxLength: 10
# - id: 'properties.editable.autoSize: true'
# icon: PlusOutlined
# - id: 'properties.editable.tooltip'
# type: ParagraphInput
# properties:
# editable:
# autoSize: true
# - id: 'properties.editable.autoSize: min max'
# tooltip: Change the value
# # FIX: TypeError: Cannot read property 'focus' of null
# # - id: 'properties.editable.editing: true'
# # type: ParagraphInput
# # properties:
# # editable:
# # editing: true
# - id: 'properties.editable.maxLength: 10'
# type: ParagraphInput
# properties:
# editable:
# autoSize:
# minRows: 2
# maxRows: 4
# maxLength: 10
# # - id: 'properties.editable.autoSize: true'
# # type: ParagraphInput
# # properties:
# # editable:
# # autoSize: true
# # - id: 'properties.editable.autoSize: min max'
# # type: ParagraphInput
# # properties:
# # editable:
# # autoSize:
# # minRows: 2
# # maxRows: 4

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row } from 'antd';
import block from './index.js';
import Block from './PasswordInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -47,4 +51,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './PasswordInput.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Progress.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,12 +16,15 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Progress.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row, Space } from 'antd';
import block from './index.js';
import Block from './RadioSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -48,4 +52,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './RadioSelector.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -17,11 +17,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import { Col, Row, Space } from 'antd';
import block from './index.js';
import Block from './RatingSlider.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -50,4 +54,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -16,18 +16,16 @@
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './RatingSlider.js';
import examples from './examples.yaml';
import schema from './schema.json';
import validationsExamples from '../../validationExamples.js';
// test: {
// validation: true,
// required: true,
// }
const testConfig = {
validation: true,
required: true,
values: [],
};
const { meta, tests } = block;
runRenderTests({ examples, Block, meta, schema, tests, validationsExamples });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig, validationsExamples });
runBlockSchemaTests({ examples, schema });

View File

@ -16,11 +16,15 @@
import { runMockRenderTests } from '@lowdefy/block-dev';
import block from './index.js';
import Block from './Result.js';
import examples from './examples.yaml';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
jest.mock('antd', () => {
const comp = jest.fn(() => 'mocked');
@ -43,4 +47,4 @@ const mocks = [
},
];
runMockRenderTests({ examples, meta, mocks, schema, tests });
runMockRenderTests({ Block, examples, mocks, schema, testConfig });

View File

@ -18,10 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
import Block from './Result.js';
import examples from './examples.yaml';
import block from './index.js';
import schema from './schema.json';
const { meta, tests } = block;
const testConfig = {
validation: true,
required: true,
values: [],
};
runRenderTests({ examples, Block, meta, schema, tests });
runBlockSchemaTests({ examples, meta, schema });
runRenderTests({ Block, examples, schema, testConfig });
runBlockSchemaTests({ examples, schema });

Some files were not shown because too many files have changed in this diff Show More