Fix js tests
[MAILPOET-2835]
This commit is contained in:
@@ -1,37 +1,7 @@
|
|||||||
import MailPoet from 'mailpoet';
|
import MailPoet from 'mailpoet';
|
||||||
import icon from './icon.jsx';
|
import icon from './icon.jsx';
|
||||||
import edit from './edit';
|
import edit from './edit';
|
||||||
|
import { defaultAttributes } from './divider_types';
|
||||||
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',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const name = 'mailpoet-form/divider';
|
export const name = 'mailpoet-form/divider';
|
||||||
|
|
||||||
|
30
assets/js/src/form_editor/blocks/divider/divider_types.ts
Normal file
30
assets/js/src/form_editor/blocks/divider/divider_types.ts
Normal 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',
|
||||||
|
};
|
@@ -10,11 +10,7 @@ import {
|
|||||||
SelectControl,
|
SelectControl,
|
||||||
ToggleControl,
|
ToggleControl,
|
||||||
} from '@wordpress/components';
|
} from '@wordpress/components';
|
||||||
import {
|
import { Attributes, Style, Types } from './divider_types';
|
||||||
Attributes,
|
|
||||||
Style,
|
|
||||||
Types,
|
|
||||||
} from './divider';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
attributes: Attributes,
|
attributes: Attributes,
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
import { has } from 'lodash';
|
import { has } from 'lodash';
|
||||||
import asNum from './server_value_as_num';
|
import asNum from './server_value_as_num';
|
||||||
import formatCustomFieldBlockName from '../blocks/format_custom_field_block_name.jsx';
|
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()}`);
|
const generateId = () => (`${Math.random().toString()}-${Date.now()}`);
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
"autoprefixer": "postcss assets/dist/css/*.css --use autoprefixer --no-map --replace",
|
"autoprefixer": "postcss assets/dist/css/*.css --use autoprefixer --no-map --replace",
|
||||||
"scss": "node-sass assets/css/src/ --output assets/dist/css/ --output-style compact",
|
"scss": "node-sass assets/css/src/ --output assets/dist/css/ --output-style compact",
|
||||||
"stylelint": "stylelint --fix",
|
"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",
|
"check-types": "tsc --noEmit",
|
||||||
"storybook": "start-storybook -s ./ -p 8083",
|
"storybook": "start-storybook -s ./ -p 8083",
|
||||||
"build-storybook": "build-storybook"
|
"build-storybook": "build-storybook"
|
||||||
|
Reference in New Issue
Block a user