diff --git a/package.json b/package.json index fc04e92..f009a9a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "liquor-tree", "description": "A Vue.js tree component.", - "version": "0.2.64", + "version": "0.2.65", "author": "Kostiantyn ", "library": "LiquorTree", "homepage": "https://amsik.github.io/liquor-tree/", @@ -57,6 +57,7 @@ "vue-template-compiler": "^2.5.17" }, "jest": { + "setupFiles": ["./test/setupTests.js"], "moduleFileExtensions": [ "js", "vue" diff --git a/src/lib/Tree.js b/src/lib/Tree.js index 4081a5a..5d618ca 100644 --- a/src/lib/Tree.js +++ b/src/lib/Tree.js @@ -238,9 +238,11 @@ export default class Tree { setModel (data) { this.model = this.parse(data, this.options.modelParse) + /* eslint-disable */ requestAnimationFrame(_ => { this.vm.model = this.model }) + /* eslint-enable */ /** * VueJS transform properties to reactives when constructor is running diff --git a/test/setupTests.js b/test/setupTests.js new file mode 100644 index 0000000..a6adfe0 --- /dev/null +++ b/test/setupTests.js @@ -0,0 +1,3 @@ +global.requestAnimationFrame = function (callback) { + setTimeout(callback, 0) +}