Add simple unit tests for Select component

This commit is contained in:
Sergio Crisostomo 2017-08-27 17:09:36 +02:00
parent 62f5dd0c30
commit 3b9de2499e
2 changed files with 206 additions and 0 deletions

View file

@ -83,3 +83,13 @@ exports.triggerEvent = function(elm, name, ...opts) {
return elm;
};
/**
* Wait for components inner async process, when this.$nextTick is not enough
* @param {Function} the condition to verify before calling the callback
* @param {Function} the callback to call when condition is true
*/
exports.waitForIt = function waitForIt(condition, callback) {
if (condition()) callback();
else setTimeout(() => waitForIt(condition, callback), 50);
};