File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -242,5 +242,33 @@ if (_.inBrowser) {
242
242
} )
243
243
} )
244
244
245
+ it ( 'should handle container/replacer directives with same name' , function ( ) {
246
+ var parentSpy = jasmine . createSpy ( )
247
+ var childSpy = jasmine . createSpy ( )
248
+ vm = new Vue ( {
249
+ el : el ,
250
+ template :
251
+ '<div v-component="a" class="a" v-on="click:test(1)"></div>' ,
252
+ methods : {
253
+ test : parentSpy
254
+ } ,
255
+ components : {
256
+ a : {
257
+ template : '<div class="b" v-on="click:test(2)"></div>' ,
258
+ replace : true ,
259
+ methods : {
260
+ test : childSpy
261
+ }
262
+ }
263
+ }
264
+ } )
265
+ expect ( vm . $el . firstChild . className ) . toBe ( 'b a' )
266
+ var e = document . createEvent ( 'HTMLEvents' )
267
+ e . initEvent ( 'click' , true , true )
268
+ vm . $el . firstChild . dispatchEvent ( e )
269
+ expect ( parentSpy ) . toHaveBeenCalledWith ( 1 )
270
+ expect ( childSpy ) . toHaveBeenCalledWith ( 2 )
271
+ } )
272
+
245
273
} )
246
274
}
You can’t perform that action at this time.
0 commit comments