Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('set duration', async function() {
this.enableTimeouts(false);
Message.info('test', 500);
const message = getElement('.k-message');
expect(message.outerHTML).to.matchSnapshot();
// should not remove when mouseenter
dispatchEvent(message, 'mouseenter');
await wait(1000);
let message1 = getElement('.k-message');
expect(message1).eql(message);
dispatchEvent(message, 'mouseleave');
await wait(300);
message1 = getElement('.k-message');
expect(message1).eql(message);
await wait(700);
message1 = getElement('.k-message');
import React from 'react';
import {Form, FormItem} from 'kpc/components/form';
import {Input} from 'kpc/components/input';
import {Button} from 'kpc/components/button';
import './index.styl';
// 添加全局规则
Form.addMethod('letter', (value, item, param) => {
return /^[a-z|A-Z]+$/.test(value);
}, '只能输入字母');
export default class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {
"descriptions": [
"",
""
]
};
this._onChangeValue = this._onChangeValue.bind(this);
this.add = this.add.bind(this);
this.remove = this.remove.bind(this);
}
export {default as data} from './index.json';
import Intact from 'intact';
import template from './index.vdt';
import './index.styl';
import {Form} from 'kpc/components/form';
// 添加全局规则
Form.addMethod('letter', (value, item, param) => {
return /^[a-z|A-Z]+$/.test(value);
}, '只能输入字母');
export default class extends Intact {
@Intact.template()
static template = template;
defaults() {
return {
descriptions: ['', '']
}
}
add() {
this.set('descriptions', this.get('descriptions').concat(''));
}
}, () => {
// if error, don't close dialog
dialog.hideLoading();
Message.error('error occured');
});
}
}, () => {
// if error, don't close dialog
dialog.hideLoading();
Message.error('error occured');
});
}
}, () => {
// if error, don't close dialog
dialog.hideLoading();
Message.error('error occured');
});
}
_fetch1(c, current) {
// fetch data
this.set('current1', current);
Message.info(`current page: ${current}`);
}
_mount() {
// 通过container来指明挂载点
this.app = new App({container: this.refs.container});
}
var webpackConfig = require('kpc/src/webpack.config');
var path = require('path');
var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
webpackConfig.entry.all = path.resolve(__dirname, './js/app/routes.js');
webpackConfig.output.path = path.resolve(__dirname, './dist');
// webpackConfig.output.filename = '[name].[chunkhash:8].js';
process.disableHardSource = true;
process.disableHMR = true;
webpackConfig.module.rules.push({
test: /\.json$/,
loader: 'json-loader'
});
webpackConfig.module.noParse = [
/node_modules\/benchmark/
];
webpackConfig.module.rules[0].exclude = [
/node_modules(?!([\/\\]kpc)|([\/\\]misstime))/,
/node_modules[\/\\]kpc.*lib/
];
// webpackConfig.plugins = webpackConfig.plugins.filter(item => {
// return !(item instanceof webpack.optimize.UglifyJsPlugin);
// });
// webpackConfig.plugins.push(
// new webpack.ProvidePlugin({
// Intact: 'kpc/src/js/lib/intact',
// _: 'kpc/src/js/lib/underscore',
// }),
// new HtmlWebpackPlugin({
// template: path.resolve(__dirname, './index.html'),