Skip to content

Commit 379695c

Browse files
committed
complete coverage by testing v-model with extra listeners
1 parent b4115f7 commit 379695c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: test/unit/features/directives/model-component.spec.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@ describe('Directive v-model component', () => {
3737
})
3838

3939
it('should support customization via model option', done => {
40+
const spy = jasmine.createSpy('update')
4041
const vm = new Vue({
4142
data: {
4243
msg: 'hello'
4344
},
45+
methods: {
46+
spy
47+
},
4448
template: `
4549
<div>
4650
<p>{{ msg }}</p>
47-
<test v-model="msg"></test>
51+
<test v-model="msg" @update="spy"></test>
4852
</div>
4953
`,
5054
components: {
@@ -66,6 +70,7 @@ describe('Directive v-model component', () => {
6670
}).then(() => {
6771
expect(vm.msg).toEqual('world')
6872
expect(vm.$el.querySelector('p').textContent).toEqual('world')
73+
expect(spy).toHaveBeenCalledWith('world')
6974
vm.msg = 'changed'
7075
}).then(() => {
7176
expect(vm.$el.querySelector('p').textContent).toEqual('changed')

0 commit comments

Comments
 (0)