title: React + Jest check component contains another component
body: <p>I have <code>DetailPanel</code> component which contains <code>Detail</code> componet with <code>title</code> prop.</p>
  
  <pre><code>import React from 'react';
  import Detail from './Detail';
  import InfoTable from './InfoTable';
  import EdgeIcon from './EdgeIcon';
  import styles from './DetailsPanel.css';
  
  export default class DetailsPanel extends React.PureComponent {
  
    renderTitle() {
      const { selectedEdge } = this.props;
  
      if (selectedEdge) {
        const sourceNode = 'sourceNode'
        const targetNode = 'targetNode'
  
        return (
          &lt;span&gt;
            {sourceNode}
            &lt;EdgeIcon className={styles.arrowIcon} /&gt;
            {targetNode}
          &lt;/span&gt;
        );
      }
  
      return 'default title';
    }
  
    render() {
      return (
        &lt;Detail title={this.renderTitle()} /&gt;
      );
    }
  }
  </code></pre>
  
  <p>I tying to check that if <code>selectedEdge</code> is <code>true</code> Detail title contains <code>EdgeIcon</code> component</p>
  
  <pre><code>test('Detail should contain EdgeIcon if there is selected edge', () =&gt; {
    const selectedEdge = { source: 1, target: 2 };
    const detailsPanel = shallow(
      &lt;DetailsPanel
        {...props}
        selectedEdge={selectedEdge}
      /&gt;);
    expect(detailsPanel.contains('EdgeIcon')).toBeTruthy();
  });
  </code></pre>
  
  <p>But test fails, because detailsPanel returns <code>false</code></p>