@@ -20,12 +20,14 @@ describeWithShallowAndMount('find', mountingMethod => {
20
20
const compiled = compileToFunctions ( '<div><p></p><p></p></div>' )
21
21
const wrapper = mountingMethod ( compiled )
22
22
expect ( wrapper . find ( 'p' ) . vnode ) . to . be . an ( 'object' )
23
+ expect ( wrapper . find ( 'p' ) . vm ) . to . equal ( undefined )
23
24
} )
24
25
25
26
it ( 'returns Wrapper matching class selector passed' , ( ) => {
26
27
const compiled = compileToFunctions ( '<div><div class="foo" /></div>' )
27
28
const wrapper = mountingMethod ( compiled )
28
29
expect ( wrapper . find ( '.foo' ) . vnode ) . to . be . an ( 'object' )
30
+ expect ( wrapper . find ( '.foo' ) . vm ) . to . equal ( undefined )
29
31
} )
30
32
31
33
it ( 'returns Wrapper matching class selector passed if nested in a transition' , ( ) => {
@@ -395,4 +397,20 @@ describeWithShallowAndMount('find', mountingMethod => {
395
397
. with . property ( 'message' , message )
396
398
} )
397
399
} )
400
+
401
+ itDoNotRunIf (
402
+ mountingMethod . name === 'shallowMount' ,
403
+ 'returns a VueWrapper instance by CSS selector if the element binds a Vue instance' , ( ) => {
404
+ const childComponent = {
405
+ name : 'bar' ,
406
+ template : '<p/>'
407
+ }
408
+ const wrapper = mountingMethod ( {
409
+ name : 'foo' ,
410
+ template : '<div><child-component /></div>' ,
411
+ components : { childComponent }
412
+ } )
413
+ expect ( wrapper . find ( 'div' ) . vm . $options . name ) . to . equal ( 'foo' )
414
+ expect ( wrapper . find ( 'p' ) . vm . $options . name ) . to . equal ( 'bar' )
415
+ } )
398
416
} )
0 commit comments