title: Test React Component with Jest and Enzyme, which are returned by a map function
body: <p>i'm using Jest and Enzyme to test React components, but i found difficulties on testing a simple stateless component which consist on the result of a map javascript function.  </p>
  
  <p><strong>MovieCard.js</strong> Component:  </p>
  
  <pre><code>import React from 'react'
  import PropTypes from 'prop-types'
  
  const MovieCard = ({ resultsForSubmit }) =&gt;
    (
      resultsForSubmit.map(r =&gt; (
        &lt;article className="card" key={r.imdbID}&gt;
          &lt;a href={r.Poster}&gt;
            &lt;picture className="thumbnail"&gt;
              &lt;img src={(r.Poster !== "N/A")? r.Poster : "src/assets/not-found.png"} alt={r.Title} /&gt;
            &lt;/picture&gt;
          &lt;/a&gt;
          &lt;div className="card-content clearfix"&gt;
            &lt;div className="review"&gt;
              &lt;h2&gt;{r.Title}&lt;/h2&gt;
              &lt;p&gt;{r.Type}&lt;/p&gt;
            &lt;/div&gt;
            &lt;div className="reviewer"&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/article&gt;
      )
      )
    )
  
  export default MovieCard;
  
  MovieCard.propTypes = {
    resultsForSubmit: PropTypes.array,
  }
  </code></pre>
  
  <p><strong>MovieCard.test.js</strong></p>
  
  <pre><code>import React from 'react'
  import { mount  } from 'enzyme'
  import MovieCard from './MovieCard';
  
  describe('&lt;MovieCard /&gt;&lt;MovieCard /&gt;', () =&gt; {
      const data = [
          { imdbId: '2', Poster: 'poster2', Title: 'title2', Type: 'type2' }
      ];
  
      it('renders 2 &lt;MovieCard /&gt; components', () =&gt; {
          mount(&lt;MovieCard data={ data } /&gt;);
      });
  }) 
  </code></pre>
  
  <p><strong>when i run the test, this error is shown :</strong></p>
  
  <pre><code>**&lt;MovieCard /&gt;&lt;MovieCard /&gt; › renders 2 &lt;MovieCard /&gt; components
  
      TypeError: Cannot read property 'map' of undefined
  
        4 | const MovieCard = ({ resultsForSubmit }) =&gt;
        5 |   (
      &gt; 6 |     resultsForSubmit.map(r =&gt; (
          |                      ^
        7 |       &lt;article className="card" key={r.imdbID}&gt;
        8 |         &lt;a href={r.Poster}&gt;
        9 |           &lt;picture className="thumbnail"&gt;**
  </code></pre>
  
  <p>For now i just want to test if the component is rendered, but i'm open to suggestion for using other testing functions on it.</p>