1.0.0-beta.24
https://jsfiddle.net/r8Lq6h2b/
template:
<b-form-select :options="selectList" v-model="selected.property" id="bselect"></b-form-select>
data:
data () {
return {
selectList: [],
selected: {}
}
}
created:
this.selectList=['item1','item2','item3'],
this.selected={property:'item1',name:'name'}
watch:
watch: {
'selected.property': function (value) {
console.log('selected.property changed')
this.selected.name='watchChanged'
}
}
spec.js:
before(async () => {
const options = wrapper.find('#bselect')
console.log('wrapper.vm.selected.property1:' wrapper.vm.selected.property)
options.at(1).setSelected()
await wrapper.vm.$nextTick()
})
it('selected.property changed', () => {
console.log('wrapper.vm.selected.property2:' wrapper.vm.selected.property)
expect(wrapper.wm.selected.name).to.equal('watchChanged')
})
expect(wrapper.wm.selected.name).to.equal('watchChanged')
expect is true
expect(wrapper.wm.selected.name).to.equal('watchChanged')
is run failed,return false
console:
wrapper.vm.selected.property1:item1
wrapper.vm.selected.property:2item2
but
console.log('selected.property changed')
It is not printed on the console。
I feel very strange, can you help me?
Please can you provide a runnable reproduction as a GitHub repository
The problem is solved
@azui007 How did you solve this problem?
hey @azui007 it would be great if you share your knowledge about how you have solved the problem as it would help others