Closed
Description
Version
1.0.0-beta
Reproduction link
https://github.com/autumnwoodberry/vtu
Steps to reproduce
Nest some v-if
:
<transition>
<div v-if="a">
<transition v-if="b"></transition>
<transition v-if="!b"></transition>
</div>
</transition>
test('output', () => {
wrapper.setData({
a: true,
b: true
});
expect(wrapper.vm.a).toBe(true)
expect(wrapper.vm.b).toBe(true)
expect(wrapper.html()).toMatchSnapshot()
})
What is expected?
wrapper.html()
returns the updated markup.
What is actually happening?
wrapper.html()
returns outdated markup unless the test is changed to:
test('output', () => {
wrapper.setData({
a: true,
b: true
});
expect(wrapper.vm.a).toBe(true)
expect(wrapper.vm.b).toBe(true)
Vue.nextTick(() => {
expect(wrapper.html()).toMatchSnapshot()
})
})