Fix js tests
[MAILPOET-2835]
This commit is contained in:
@@ -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';
|
||||
|
||||
|
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,
|
||||
ToggleControl,
|
||||
} from '@wordpress/components';
|
||||
import {
|
||||
Attributes,
|
||||
Style,
|
||||
Types,
|
||||
} from './divider';
|
||||
import { Attributes, Style, Types } from './divider_types';
|
||||
|
||||
type Props = {
|
||||
attributes: Attributes,
|
||||
|
@@ -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()}`);
|
||||
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user