@@ -20,12 +20,14 @@ describeWithShallowAndMount('find', mountingMethod => {
2020 const compiled = compileToFunctions ( '<div><p></p><p></p></div>' )
2121 const wrapper = mountingMethod ( compiled )
2222 expect ( wrapper . find ( 'p' ) . vnode ) . to . be . an ( 'object' )
23+ expect ( wrapper . find ( 'p' ) . vm ) . to . equal ( undefined )
2324 } )
2425
2526 it ( 'returns Wrapper matching class selector passed' , ( ) => {
2627 const compiled = compileToFunctions ( '<div><div class="foo" /></div>' )
2728 const wrapper = mountingMethod ( compiled )
2829 expect ( wrapper . find ( '.foo' ) . vnode ) . to . be . an ( 'object' )
30+ expect ( wrapper . find ( '.foo' ) . vm ) . to . equal ( undefined )
2931 } )
3032
3133 it ( 'returns Wrapper matching class selector passed if nested in a transition' , ( ) => {
@@ -395,4 +397,20 @@ describeWithShallowAndMount('find', mountingMethod => {
395397 . with . property ( 'message' , message )
396398 } )
397399 } )
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+ } )
398416} )
0 commit comments