Add more DatePicker tests

This commit is contained in:
Sergio Crisostomo 2017-08-29 09:45:07 +02:00
parent 3747aecd53
commit db1b716f29
2 changed files with 119 additions and 1 deletions

View file

@ -57,6 +57,16 @@ exports.createTest = function(Compo, propsData = {}, mounted = false) {
return new Ctor({ propsData }).$mount(mounted === false ? null : elm);
};
/**
* Transform Date string (yyyy-mm-dd hh:mm:ss) to Date object
* @param {String}
*/
exports.stringToDate = function(str) {
const parts = str.split(/[^\d]/).filter(Boolean);
parts[1] = parts[1] - 1;
return new Date(...parts);
};
/**
* 触发一个事件
* mouseenter, mouseleave, mouseover, keyup, change, click