mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-05 13:59:56 +08:00
fix(blocks-basic): Refactored tests to use new Block config.
This commit is contained in:
parent
1919560235
commit
37ba69dd60
@ -17,11 +17,14 @@
|
||||
import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
|
||||
|
||||
import Block from './Anchor.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 });
|
||||
|
@ -21,14 +21,18 @@ import userEvent from '@testing-library/user-event';
|
||||
|
||||
import Block from './Box.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('triggerEvent onClick', () => {
|
||||
|
@ -20,14 +20,18 @@ import { render } from '@testing-library/react';
|
||||
|
||||
import Block from './DangerousHtml.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('update on properties.html change', () => {
|
||||
|
@ -20,14 +20,18 @@ import { render } from '@testing-library/react';
|
||||
|
||||
import Block from './Html.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('update on properties.html change', () => {
|
||||
|
@ -18,9 +18,13 @@ import { runBlockSchemaTests, runRenderTests } from '@lowdefy/block-dev';
|
||||
|
||||
import Block from './Icon.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
@ -21,14 +21,18 @@ import userEvent from '@testing-library/user-event';
|
||||
|
||||
import Block from './Img.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('triggerEvent onClick', () => {
|
||||
|
@ -21,14 +21,18 @@ import userEvent from '@testing-library/user-event';
|
||||
|
||||
import Block from './List.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
runBlockSchemaTests({ examples, meta, schema });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('triggerEvent onClick', () => {
|
||||
|
@ -21,14 +21,18 @@ import userEvent from '@testing-library/user-event';
|
||||
|
||||
import Block from './Span.js';
|
||||
import examples from './examples.yaml';
|
||||
import block from './index.js';
|
||||
import schema from './schema.json';
|
||||
|
||||
const { meta, tests } = block;
|
||||
runRenderTests({ examples, Block, meta, schema, tests });
|
||||
const testConfig = {
|
||||
validation: true,
|
||||
required: true,
|
||||
values: [],
|
||||
};
|
||||
|
||||
runRenderTests({ Block, examples, schema, testConfig });
|
||||
runBlockSchemaTests({ examples, schema });
|
||||
|
||||
const { before, methods, getProps } = mockBlock({ meta, schema });
|
||||
const { before, methods, getProps } = mockBlock({ meta: Block.meta, schema });
|
||||
beforeEach(before);
|
||||
|
||||
test('triggerEvent onClick', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user