File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
test/unit/features/directives Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11import Vue from 'vue'
22
33describe ( 'Directive v-on' , ( ) => {
4- let vm , spy , spy2 , el
4+ let vm , spy , el
55
66 beforeEach ( ( ) => {
77 spy = jasmine . createSpy ( )
8- spy2 = jasmine . createSpy ( )
98 el = document . createElement ( 'div' )
109 document . body . appendChild ( el )
1110 } )
@@ -88,12 +87,15 @@ describe('Directive v-on', () => {
8887 template : `
8988 <input type="checkbox" ref="input" @click.prevent="foo">
9089 ` ,
91- methods : { foo : spy2 }
90+ methods : {
91+ foo ( $event ) {
92+ spy ( $event . defaultPrevented )
93+ }
94+ }
9295 } )
9396 vm . $refs . input . checked = false
9497 triggerEvent ( vm . $refs . input , 'click' )
95- expect ( spy2 ) . toHaveBeenCalled ( )
96- expect ( vm . $refs . input . checked ) . toBe ( false )
98+ expect ( spy ) . toHaveBeenCalledWith ( true )
9799 } )
98100
99101 it ( 'should support capture' , ( ) => {
You can’t perform that action at this time.
0 commit comments