title: How to test a children text component with Jest & Enzyme
body: <p>I'm writing the test suite of my React Native application and I was wondering how to test the shallow rendering of a React Native child component with Jest &amp; Enzyme.</p>
  
  <pre><code>import { shallow } from 'enzyme'
  import toJson from 'enzyme-to-json'
  import React from 'react'
  
  import NextButton from './NextButton'
  
  describe('NextButton component', () =&gt; {
    describe('Rendering', () =&gt; {
      let onPress, text, wrapper
  
      beforeEach(() =&gt; {
        onPress = jest.fn()
        text = 'Test button'
        wrapper = shallow(&lt;NextButton onPress={onPress}&gt;{text}&lt;/NextButton&gt;)
      })
  
      test('should render NextButton correctly', () =&gt; {
        expect(toJson(wrapper)).toMatchSnapshot()
      })
  
      test('should have text rendered as a child', () =&gt; {
        expect(toJson(wrapper.prop('children'))).toEqual(text)
      })
    })
  })
  </code></pre>
  
  <p>The previous code gives this error, Jest doesn't find the <code>children</code> prop.</p>
  
  <pre><code>Expected: "Test button"
  Received: undefined
  </code></pre>