title: Jest Enzyme how to shallow test for existence of wrapped component
body: <p>I am testing a component that conditionally renders a wrapped component. I am using enzyme and jest and the root component is rendered through the shallow() method.
  The issue is testing if the Root component contains the wrapped component.</p>
  
  <p>How would I test if the wrapped component exists without using the mount() render method?</p>
  
  <p><em>hoc.component.jsx</em></p>
  
  <pre><code>export function HOC(Component) {
     render() {
       return &lt;Component /&gt; 
     }
  }
  </code></pre>
  
  <p><em>wrapped.component.jsx</em></p>
  
  <pre><code>class WrappedComponent extends React.Component {
    ...
  }
  
  export default HOC(WrappedComponent)
  </code></pre>
  
  <p><em>root.component.jsx</em></p>
  
  <pre><code>class RootComponent extends React.Component {
     render() {
       return (
          condition ? ... :
           &lt;WrappedComponent/&gt;
       )
     }
  }
  </code></pre>
  
  <p>When testing the <em>root.component.jsx</em> I would like to check if the WrappedComponent exists. </p>
  
  <p><em>root.component.spec.js</em>
      import { WrappedComponent } from 'WrappedComponent'</p>
  
  <pre><code>const wrapper = shallow(&lt;RootComponent {...props}/&gt;);
  wrapper.find(WrappedComponent).length =&gt; returns 0
  </code></pre>
  
  <p>If I log wrapper.debug() I see the following:</p>
  
  <pre><code>...&lt;HOC(WrappedComponent) /&gt;
  </code></pre>
  
  <p>How would I test the existence of the WrappedComponent while testing the RootComponent?</p>