diff --git a/test/unit/features/directives/on.spec.js b/test/unit/features/directives/on.spec.js index fd65b7eb40a..e7f43bc7d51 100644 --- a/test/unit/features/directives/on.spec.js +++ b/test/unit/features/directives/on.spec.js @@ -1,11 +1,10 @@ import Vue from 'vue' describe('Directive v-on', () => { - let vm, spy, spy2, el + let vm, spy, el beforeEach(() => { spy = jasmine.createSpy() - spy2 = jasmine.createSpy() el = document.createElement('div') document.body.appendChild(el) }) @@ -88,12 +87,15 @@ describe('Directive v-on', () => { template: ` `, - methods: { foo: spy2 } + methods: { + foo ($event) { + spy($event.defaultPrevented) + } + } }) vm.$refs.input.checked = false triggerEvent(vm.$refs.input, 'click') - expect(spy2).toHaveBeenCalled() - expect(vm.$refs.input.checked).toBe(false) + expect(spy).toHaveBeenCalledWith(true) }) it('should support capture', () => {