@@ -8,8 +8,9 @@ describe('Vue.events', () => {
8
8
this . $trigger ( 'someEvent' , 'foo' ) ;
9
9
} ,
10
10
events : {
11
- someEvent ( param ) {
11
+ someEvent ( event , param ) {
12
12
expect ( param ) . toBe ( 'foo' ) ;
13
+ expect ( event . name ) . toBe ( 'someEvent' ) ;
13
14
}
14
15
}
15
16
} ) ;
@@ -21,7 +22,7 @@ describe('Vue.events', () => {
21
22
this . $trigger ( 'paramArray' , [ 'foo' , 'bar' ] ) ;
22
23
} ,
23
24
events : {
24
- paramArray ( param , param2 ) {
25
+ paramArray ( event , param , param2 ) {
25
26
expect ( param ) . toBe ( 'foo' ) ;
26
27
expect ( param2 ) . toBe ( 'bar' ) ;
27
28
}
@@ -35,7 +36,7 @@ describe('Vue.events', () => {
35
36
this . $trigger ( 'paramObject' , { foo : 'bar' } ) ;
36
37
} ,
37
38
events : {
38
- paramObject ( param ) {
39
+ paramObject ( event , param ) {
39
40
expect ( param . foo ) . toBe ( 'bar' ) ;
40
41
}
41
42
}
@@ -54,15 +55,15 @@ describe('Vue.events', () => {
54
55
prioHandler : [
55
56
{
56
57
// handler callback
57
- handler ( param ) {
58
+ handler ( event , param ) {
58
59
this . lastPrio = 10 ;
59
60
} ,
60
61
// a higher priority, means earlier execution
61
62
priority : 10
62
63
} ,
63
64
{
64
65
// handler callback
65
- handler ( param ) {
66
+ handler ( event , param ) {
66
67
expect ( this . lastPrio ) . toBe ( 10 ) ;
67
68
this . lastPrio = - 10 ;
68
69
} ,
@@ -85,7 +86,7 @@ describe('Vue.events', () => {
85
86
}
86
87
} ,
87
88
events : {
88
- testEvent ( param ) {
89
+ testEvent ( event , param ) {
89
90
this . isLoaded = true ;
90
91
expect ( this . isLoaded ) . toBe ( true ) ;
91
92
}
@@ -95,7 +96,7 @@ describe('Vue.events', () => {
95
96
var vm2 = new Vue ( {
96
97
events : {
97
98
testEvent :{
98
- handler ( param ) {
99
+ handler ( event , param ) {
99
100
expect ( param ) . toBe ( 'foo' ) ;
100
101
} ,
101
102
priority : 10
@@ -114,7 +115,7 @@ describe('Vue.events', () => {
114
115
}
115
116
} ,
116
117
events : {
117
- actionCancel ( param ) {
118
+ actionCancel ( event , param ) {
118
119
this . isLoaded = true ;
119
120
return "lastAction" ;
120
121
}
@@ -124,7 +125,7 @@ describe('Vue.events', () => {
124
125
var vm2 = new Vue ( {
125
126
events : {
126
127
actionCancel :{
127
- handler ( param ) {
128
+ handler ( event , param ) {
128
129
expect ( param ) . toBe ( 'foo' ) ;
129
130
return false ;
130
131
} ,
0 commit comments