Closed
Description
Version
1.0.0-beta.10
Reproduction link
Steps to reproduce
// setProps.spec.js
it('should update after setProps', () => {
const prop1 = {}
const prop2 = 'val1'
const wrapper = mount(ComponentWithProps, {
propsData: { prop1, prop2 }
})
expect(wrapper.props()).to.eql({ prop1: {}, prop2: 'val1' })
// setProps
wrapper.setProps({ prop2: 'val2' })
expect(wrapper.vm.prop2).to.eql('val2') // pass
expect(wrapper.props()).to.eql({ prop1: {}, prop2: 'val2' }) // fail still prop2: 'val1'
})
I write a test-case in my fork. you can try it.
What is expected?
wrapper.props() should be updated
What is actually happening?
no update know.
The props of wrapper.vm
are updated, maybe this is deliberately designed?