title: Jest/Enzyme shallow testing React stateless component - wrapper.find() not working
body: <p>I have problem with testing my React SFC. I'd like to test if 'PointDetailConfig' has two 'DayHours' components (can be mocked). I don't know why wrapper.find() not finding 'DayHours'. It worked with React statefull component. Received value indicate that 'DayHours' is props.children. Should I assert wrapper.props().children?  Thanks for any tips how to test it properly.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>expect(received).toHaveLength(length)
  
      Expected value to have length:
        2
      Received:
        {Symbol(enzyme.__root__): {Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__unrendered__): &lt;PointDetailConfig increaseCurrentDayPeriod={[]} increaseNextDayPeriod={[]} reduceCurrentDayPeriod={[]} reduceNextDayPeriod={[]} /&gt;, Symbol(enzyme.__renderer__): {"batchedUpdates": [Function batchedUpdates], "getNode": [Function getNode], "render": [Function render], "simulateEvent": [Function simulateEvent], "unmount": [Function unmount]}, Symbol(enzyme.__node__): {"instance": null, "key": undefined, "nodeType": "host", "props": {"children": [&lt;DayHours increaseCurrentDayPeriod={[]} increaseHours={[]} increaseNextDayPeriod={[]} name="some name" reduceCurrentDayPeriod={[]} reduceHours={[]} reduceNextDayPeriod={[]} /&gt;, &lt;DayHours increaseCurrentDayPeriod={[]} increaseHours={[]} increaseNextDayPeriod={[]} name="some name" reduceCurrentDayPeriod={[]} reduceHours={[]} reduceNextDayPeriod={[]} /&gt;]}, "ref": null, "rendered": [{"instance": null, "key": undefined, "nodeType": "function", "props": {"increaseCurrentDayPeriod": [], "increaseHours": [], "increaseNextDayPeriod": [], "name": "Doba bieżąca", "reduceCurrentDayPeriod": [], "reduceHours": [], "reduceNextDayPeriod": []}, "ref": null, "rendered": null, "type": [Function DayHours]}, {"instance": null, "key": undefined, "nodeType": "function", "props": {"increaseCurrentDayPeriod": [], "increaseHours": [], "increaseNextDayPeriod": [], "name": "Doba następna", "reduceCurrentDayPeriod": [], "reduceHours": [], "reduceNextDayPeriod": []}, "ref": null, "rendered": null, "type": [Function DayHours]}], "type": "div"}, Symbol(enzyme.__nodes__): [{"instance": null, "key": undefined, "nodeType": "host", "props": {"children": [&lt;DayHours increaseCurrentDayPeriod={[]} increaseHours={[]} increaseNextDayPeriod={[]} name="some name" reduceCurrentDayPeriod={[]} reduceHours={[]} reduceNextDayPeriod={[]} /&gt;, &lt;DayHours increaseCurrentDayPeriod={[]} increaseHours={[]} increaseNextDayPeriod={[]} name="some name" reduceCurrentDayPeriod={[]} reduceHours={[]} reduceNextDayPeriod={[]} /&gt;]}, "ref": null, "rendered": [{"instance": null, "key": undefined, "nodeType": "function", "props": {"increaseCurrentDayPeriod": [], "increaseHours": [], "increaseNextDayPeriod": [], "name": "some name", "reduceCurrentDayPeriod": [], "reduceHours": [], "reduceNextDayPeriod": []}, "ref": null, "rendered": null, "type": [Function DayHours]}, {"instance": null, "key": undefined, "nodeType": "function", "props": {"increaseCurrentDayPeriod": [], "increaseHours": [], "increaseNextDayPeriod": [], "name": "some name", "reduceCurrentDayPeriod": [], "reduceHours": [], "reduceNextDayPeriod": []}, "ref": null, "rendered": null, "type": [Function DayHours]}], "type": "div"}], Symbol(enzyme.__options__): {"adapter": {"options": {"lifecycles": {"componentDidUpdate": {"prevContext": true}}, "supportPrevContextArgumentOfComponentDidUpdate": true}}, "attachTo": undefined, "disableLifecycleMethods": true, "hydrateIn": undefined}}, Symbol(enzyme.__unrendered__): null, Symbol(enzyme.__renderer__): {"batchedUpdates": [Function batchedUpdates], "getNode": [Function getNode], "render": [Function render], "simulateEvent": [Function simulateEvent], "unmount": [Function unmount]}, Symbol(enzyme.__node__): undefined, Symbol(enzyme.__nodes__): [], Symbol(enzyme.__options__): {"adapter": {"options": {"lifecycles": {"componentDidUpdate": {"prevContext": true}}, "supportPrevContextArgumentOfComponentDidUpdate": true}}, "attachTo": undefined, "disableLifecycleMethods": true, "hydrateIn": undefined}}
      received.length:
        0</code></pre>
  </div>
  </div>
  </p>
  
  <p>PointDetailConfig.test.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
      import renderer from 'react-test-renderer';
      import { shallow, configure, mount } from 'enzyme';
      import Adapter from 'enzyme-adapter-react-15';
      
      import PointDetailConfig from '../PointDetailConfig/PointDetailConfig';
      
      
      configure({ adapter: new Adapter() });
      
      // jest.mock('../PointDetailConfig/DayHours', () =&gt; {
      //     return 'DayHours mock';
      // });
      
      describe('PointDetailConfig', () =&gt; {
          let wrapper;
          let testProps;
          
          beforeEach(() =&gt; {
              testProps = {
      
              };
              wrapper = shallow(&lt;PointDetailConfig {...testProps} /&gt;, { disableLifecycleMethods: true });
          });
      
          it('should render correctly', () =&gt; {
              const tree = renderer.create(&lt;PointDetailConfig {...testProps} /&gt;);
              expect(tree.toJSON()).toMatchSnapshot();
          });
      
          it('should render DayHours', () =&gt; {
              console.log(wrapper.find('DayHours'));
              expect(wrapper.find('DayHours')).toHaveLength(2);
          });
      });</code></pre>
  </div>
  </div>
  </p>
  
  <p>PointDetailConfig.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    import React from 'react';
      import PropTypes from 'prop-types';
      import DayHours from './DayHours';
      
      
      function PointDetailConfig(props) {
          const currentDayProps = {
              increaseHours: props.increaseCurrentDayPeriod,
              reduceHours: props.reduceCurrentDayPeriod,
              name: 'some name',
              ...props
          };
          const nextDayProps = {
              increaseHours: props.increaseNextDayPeriod,
              reduceHours: props.reduceNextDayPeriod,
              name: 'some name',
              ...props
          };
          return (
              &lt;div&gt;
                  &lt;DayHours {...currentDayProps} /&gt;
                  &lt;DayHours {...nextDayProps} /&gt;
              &lt;/div&gt;
          );
      }
      
      PointDetailConfig.defaultProps = {
          //default props
      };
      
      PointDetailConfig.propTypes = {
          //define proptypes
      };
      
      export default PointDetailConfig;</code></pre>
  </div>
  </div>
  </p>