Skip to content

Commit 7f542a9

Browse files
committed
feat: add failing test for vuejs#6193
1 parent b8f1bcd commit 7f542a9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/unit/features/directives/model-select.spec.js

+29
Original file line numberDiff line numberDiff line change
@@ -517,4 +517,33 @@ describe('Directive v-model select', () => {
517517
expect(vm.test).toBe('2')
518518
}).then(done)
519519
})
520+
521+
// #6193
522+
it('should not trigger change event when match option can be found for each value', done => {
523+
const spy = jasmine.createSpy()
524+
const vm = new Vue({
525+
data: {
526+
options: ['1']
527+
},
528+
computed: {
529+
test: {
530+
get () {
531+
return '1'
532+
},
533+
set () {
534+
spy()
535+
}
536+
}
537+
},
538+
template:
539+
'<select v-model="test">' +
540+
'<option :key="opt" v-for="opt in options" :value="opt">{{ opt }}</option>' +
541+
'</select>'
542+
}).$mount()
543+
544+
vm.options = ['1', '2']
545+
waitForUpdate(() => {
546+
expect(spy).not.toHaveBeenCalled()
547+
}).then(done)
548+
})
520549
})

0 commit comments

Comments
 (0)