Fix js tests

[MAILPOET-2835]
This commit is contained in:
Pavel Dohnal
2020-04-30 15:58:13 +02:00
committed by Veljko V
parent acd7abec96
commit aed2c7cfe8
5 changed files with 34 additions and 38 deletions

View File

@@ -1,37 +1,7 @@
import MailPoet from 'mailpoet';
import icon from './icon.jsx';
import edit from './edit';
export enum Types {
Divider = 'divider',
Spacer = 'spacer',
}
export enum Style {
Solid = 'solid',
Dashed = 'dashed',
Dotted = 'dotted',
}
export interface Attributes {
className: string,
height: number;
type: Types;
style: Style;
dividerHeight: number;
dividerWidth: number;
color: string;
}
export const defaultAttributes = {
className: undefined,
height: 1,
type: Types.Divider,
style: Style.Solid,
dividerHeight: 1,
dividerWidth: 100,
color: 'black',
};
import { defaultAttributes } from './divider_types';
export const name = 'mailpoet-form/divider';

View File

@@ -0,0 +1,30 @@
export enum Types {
Divider = 'divider',
Spacer = 'spacer',
}
export enum Style {
Solid = 'solid',
Dashed = 'dashed',
Dotted = 'dotted',
}
export interface Attributes {
className: string,
height: number;
type: Types;
style: Style;
dividerHeight: number;
dividerWidth: number;
color: string;
}
export const defaultAttributes = {
className: undefined,
height: 1,
type: Types.Divider,
style: Style.Solid,
dividerHeight: 1,
dividerWidth: 100,
color: 'black',
};

View File

@@ -10,11 +10,7 @@ import {
SelectControl,
ToggleControl,
} from '@wordpress/components';
import {
Attributes,
Style,
Types,
} from './divider';
import { Attributes, Style, Types } from './divider_types';
type Props = {
attributes: Attributes,

View File

@@ -2,7 +2,7 @@
import { has } from 'lodash';
import asNum from './server_value_as_num';
import formatCustomFieldBlockName from '../blocks/format_custom_field_block_name.jsx';
import { defaultAttributes as dividerDefaultAttributes } from '../blocks/divider/divider';
import { defaultAttributes as dividerDefaultAttributes } from '../blocks/divider/divider_types';
const generateId = () => (`${Math.random().toString()}-${Date.now()}`);

View File

@@ -18,7 +18,7 @@
"autoprefixer": "postcss assets/dist/css/*.css --use autoprefixer --no-map --replace",
"scss": "node-sass assets/css/src/ --output assets/dist/css/ --output-style compact",
"stylelint": "stylelint --fix",
"test": "mocha --require tests/javascript/babel_register.js tests/javascript/**/*.spec.js",
"test": "env NODE_PATH=$NODE_PATH:./assets/js/src mocha --require tests/javascript/babel_register.js tests/javascript/**/*.spec.js",
"check-types": "tsc --noEmit",
"storybook": "start-storybook -s ./ -p 8083",
"build-storybook": "build-storybook"