chore: Fix tests.

This commit is contained in:
Gervwyk 2022-04-29 12:10:43 +02:00
parent 2e81f589fb
commit d6d10f295c
5 changed files with 18 additions and 27 deletions

View File

@ -3,19 +3,13 @@ export default {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.js'],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/src/test',
'<rootDir>/src/index.js',
'<rootDir>/src/blocks.js',
'<rootDir>/src/types.js',
],
coverageReporters: [['lcov', { projectRoot: '../../../..' }], 'text', 'clover'],
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/test', '<rootDir>/src/index.js'],
coverageReporters: [['lcov', { projectRoot: '../..' }], 'text', 'clover'],
errorOnDeprecated: true,
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,7 +16,6 @@
import React from 'react';
import { type } from '@lowdefy/helpers';
import { ErrorBoundary } from '@lowdefy/block-utils';
import { Area, BlockLayout, layoutParamsToArea } from '../../../src/index.js';
import Block from './Block.js';
@ -112,24 +111,22 @@ const AutoBlock = ({ block, makeCssClass, highlightBorders }) => {
const BindAutoBlock = ({ block, state, makeCssClass, highlightBorders }) => {
return (
<ErrorBoundary>
<Loading id={`${block.id}-loading`} showLoading>
<BlockLayout
id={`bl-${block.id}` + randomId()}
highlightBorders={highlightBorders}
layout={block.layout || {}}
blockStyle={block.style}
<Loading id={`${block.id}-loading`} showLoading>
<BlockLayout
id={`bl-${block.id}` + randomId()}
highlightBorders={highlightBorders}
layout={block.layout || {}}
blockStyle={block.style}
makeCssClass={makeCssClass}
>
<AutoBlock
block={block}
state={state}
makeCssClass={makeCssClass}
>
<AutoBlock
block={block}
state={state}
makeCssClass={makeCssClass}
highlightBorders={highlightBorders}
/>
</BlockLayout>
</Loading>
</ErrorBoundary>
highlightBorders={highlightBorders}
/>
</BlockLayout>
</Loading>
);
};