@@ -22,9 +22,9 @@ describe('runtime-dom: v-on directive', () => {
22
22
const child = document . createElement ( 'input' )
23
23
parent . appendChild ( child )
24
24
const childNextValue = withModifiers ( jest . fn ( ) , [ 'prevent' , 'stop' ] )
25
- patchEvent ( child , 'click ' , null , childNextValue , null )
25
+ patchEvent ( child , 'onClick ' , null , childNextValue , null )
26
26
const parentNextValue = jest . fn ( )
27
- patchEvent ( parent , 'click ' , null , parentNextValue , null )
27
+ patchEvent ( parent , 'onClick ' , null , parentNextValue , null )
28
28
expect ( triggerEvent ( child , 'click' ) . defaultPrevented ) . toBe ( true )
29
29
expect ( parentNextValue ) . not . toBeCalled ( )
30
30
} )
@@ -35,7 +35,7 @@ describe('runtime-dom: v-on directive', () => {
35
35
parent . appendChild ( child )
36
36
const fn = jest . fn ( )
37
37
const handler = withModifiers ( fn , [ 'self' ] )
38
- patchEvent ( parent , 'click ' , null , handler , null )
38
+ patchEvent ( parent , 'onClick ' , null , handler , null )
39
39
triggerEvent ( child , 'click' )
40
40
expect ( fn ) . not . toBeCalled ( )
41
41
} )
@@ -48,7 +48,7 @@ describe('runtime-dom: v-on directive', () => {
48
48
'esc' ,
49
49
'arrow-left'
50
50
] )
51
- patchEvent ( el , 'keyup ' , null , nextValue , null )
51
+ patchEvent ( el , 'onKeyup ' , null , nextValue , null )
52
52
53
53
triggerEvent ( el , 'keyup' , e => ( e . key = 'a' ) )
54
54
expect ( fn ) . not . toBeCalled ( )
@@ -77,15 +77,15 @@ describe('runtime-dom: v-on directive', () => {
77
77
// Case 1: <div @keyup.exact="test"/>
78
78
const fn1 = jest . fn ( )
79
79
const next1 = withModifiers ( fn1 , [ 'exact' ] )
80
- patchEvent ( el , 'keyup ' , null , next1 , null )
80
+ patchEvent ( el , 'onKeyup ' , null , next1 , null )
81
81
triggerEvent ( el , 'keyup' )
82
82
expect ( fn1 . mock . calls . length ) . toBe ( 1 )
83
83
triggerEvent ( el , 'keyup' , e => ( e . ctrlKey = true ) )
84
84
expect ( fn1 . mock . calls . length ) . toBe ( 1 )
85
85
// Case 2: <div @keyup.ctrl.a.exact="test"/>
86
86
const fn2 = jest . fn ( )
87
87
const next2 = withKeys ( withModifiers ( fn2 , [ 'ctrl' , 'exact' ] ) , [ 'a' ] )
88
- patchEvent ( el , 'keyup ' , null , next2 , null )
88
+ patchEvent ( el , 'onKeyup ' , null , next2 , null )
89
89
triggerEvent ( el , 'keyup' , e => ( e . key = 'a' ) )
90
90
expect ( fn2 ) . not . toBeCalled ( )
91
91
triggerEvent ( el , 'keyup' , e => {
@@ -109,7 +109,7 @@ describe('runtime-dom: v-on directive', () => {
109
109
const el = document . createElement ( 'div' )
110
110
const fn = jest . fn ( )
111
111
const handler = withModifiers ( fn , [ button ] )
112
- patchEvent ( el , 'mousedown ' , null , handler , null )
112
+ patchEvent ( el , 'onMousedown ' , null , handler , null )
113
113
buttons . filter ( b => b !== button ) . forEach ( button => {
114
114
triggerEvent ( el , 'mousedown' , e => ( e . button = buttonCodes [ button ] ) )
115
115
} )
0 commit comments