title: How can I test the text of a child element in enzyme?
body: <p>Using enzyme, I'm attempting to test the rendered text of a component. The component is a <code>LinkButton</code>, and it renders out like so:</p>
  
  <pre><code>&lt;a&gt;&lt;button to="/projects"&gt;See list of all projects&lt;/button&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I'm not sure how to directly reference the string "See list of all projects". I'm currently testing it as follows:</p>
  
  <pre><code>let { link } = setup({ type: 'Project' })
  link = link.shallow()
  
  const text = link.prop('children').props.children.join('')
  expect(link.prop('to')).to.eq('/projects')
  expect(text).to.eq('See list of all projects')
  </code></pre>
  
  <p><code>link</code> comes from <code>shallow(&lt;NotFoundCard /&gt;).find(LinkButton)</code>.</p>
  
  <p>I've attempted to use <code>link.find('button')</code> and <code>link.find('a')</code> but both return 0 nodes.</p>
  
  <p><strong>edit 1</strong></p>
  
  <p>Code for <code>setup</code>:</p>
  
  <pre><code>const setup = propOverrides =&gt; {
    const props = Object.assign({
      children: null,
      type: 'None',
    }, propOverrides)
  
    const wrapper = shallow(&lt;NotFoundCard {...props} /&gt;)
  
    return {
      props,
      wrapper,
      card: wrapper.find(Card),
      title: wrapper.find(CardTitle),
      text: wrapper.find(CardText),
      link: wrapper.find(LinkButton),
    }
  }
  </code></pre>