diff --git a/src/wrappers/vue-wrapper.js b/src/wrappers/vue-wrapper.js
index 06ccc8207..925e79822 100644
--- a/src/wrappers/vue-wrapper.js
+++ b/src/wrappers/vue-wrapper.js
@@ -12,12 +12,12 @@ function update () {
if (this.$_mountingOptionsSlots) {
addSlots(this, this.$_mountingOptionsSlots)
}
- const vnodes = this._render()
- this._update(vnodes)
- this.$children.forEach(child => update.call(child))
this._watchers.forEach(watcher => {
watcher.run()
})
+ const vnodes = this._render()
+ this._update(vnodes)
+ this.$children.forEach(child => update.call(child))
}
export default class VueWrapper extends Wrapper implements BaseWrapper {
diff --git a/test/unit/specs/TransitionGroupStub.spec.js b/test/unit/specs/TransitionGroupStub.spec.js
deleted file mode 100644
index 65dbfd39f..000000000
--- a/test/unit/specs/TransitionGroupStub.spec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import ComponentWithTransitionGroup from '~resources/components/component-with-transition-group.vue'
-import TransitionGroupStub from '~src/components/TransitionGroupStub'
-import { mount } from '~vue-test-utils'
-
-describe('TransitionGroupStub', () => {
- it('update synchronously when used as stubs for Transition', () => {
- const wrapper = mount(ComponentWithTransitionGroup, {
- stubs: {
- 'transition-group': TransitionGroupStub
- }
- })
- expect(wrapper.text()).contains('a')
- wrapper.setData({ a: 'b' })
- expect(wrapper.text()).contains('b')
- })
-
- // it('logs error when has multiple children', () => {
- // const TestComponent = {
- // template: `
- //
- // `
- // }
- // const msg = '[vue-test-utils]: can only be used on a single element. Use for lists.'
- // const error = sinon.stub(console, 'error')
- // mount(TestComponent, {
- // stubs: {
- // 'transition': TransitionStub
- // }
- // })
- // expect(error.args[0][0]).to.equal(msg)
- // error.restore()
- // })
-})
diff --git a/test/unit/specs/components/TransitionGroupStub.spec.js b/test/unit/specs/components/TransitionGroupStub.spec.js
new file mode 100644
index 000000000..b1f071bae
--- /dev/null
+++ b/test/unit/specs/components/TransitionGroupStub.spec.js
@@ -0,0 +1,49 @@
+import ComponentWithTransitionGroup from '~resources/components/component-with-transition-group.vue'
+import TransitionGroupStub from '~src/components/TransitionGroupStub'
+import { mount } from '~vue-test-utils'
+
+describe('TransitionGroupStub', () => {
+ it('update synchronously when used as stubs for Transition', () => {
+ const wrapper = mount(ComponentWithTransitionGroup, {
+ stubs: {
+ 'transition-group': TransitionGroupStub
+ }
+ })
+ expect(wrapper.text()).contains('a')
+ wrapper.setData({ a: 'b' })
+ expect(wrapper.text()).contains('b')
+ })
+
+ it('updates watchers', () => {
+ const TestComponent = {
+ data: () => ({
+ someWatchedData: null,
+ someData: null
+ }),
+ watch: {
+ someWatchedData (newData) {
+ console.log('asd')
+ this.someData = newData
+ }
+ },
+ template: `
+
+ {{someData}}
+
+ `
+ }
+ const wrapper = mount(TestComponent, {
+ stubs: {
+ 'transition-group': TransitionGroupStub
+ }
+ })
+ wrapper.setData({
+ someWatchedData: 'some data'
+ })
+ expect(wrapper.html()).contains('some data')
+ })
+})
diff --git a/test/unit/specs/TransitionStub.spec.js b/test/unit/specs/components/TransitionStub.spec.js
similarity index 100%
rename from test/unit/specs/TransitionStub.spec.js
rename to test/unit/specs/components/TransitionStub.spec.js