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 1
1
import Vue from 'vue'
2
2
3
3
describe ( 'Directive v-on' , ( ) => {
4
- let vm , spy , spy2 , el
4
+ let vm , spy , el
5
5
6
6
beforeEach ( ( ) => {
7
7
spy = jasmine . createSpy ( )
8
- spy2 = jasmine . createSpy ( )
9
8
el = document . createElement ( 'div' )
10
9
document . body . appendChild ( el )
11
10
} )
@@ -88,12 +87,15 @@ describe('Directive v-on', () => {
88
87
template : `
89
88
<input type="checkbox" ref="input" @click.prevent="foo">
90
89
` ,
91
- methods : { foo : spy2 }
90
+ methods : {
91
+ foo ( $event ) {
92
+ spy ( $event . defaultPrevented )
93
+ }
94
+ }
92
95
} )
93
96
vm . $refs . input . checked = false
94
97
triggerEvent ( vm . $refs . input , 'click' )
95
- expect ( spy2 ) . toHaveBeenCalled ( )
96
- expect ( vm . $refs . input . checked ) . toBe ( false )
98
+ expect ( spy ) . toHaveBeenCalledWith ( true )
97
99
} )
98
100
99
101
it ( 'should support capture' , ( ) => {
You can’t perform that action at this time.
0 commit comments