title: How to pass props into jest test in React
body: <p>I'm new to React and testing. I'm trying to test a component that has a conditional render: </p>
  
  <pre><code>render() {
  if (this.props.fetched === true){
    return (
      &lt;div className="search"&gt;
        &lt;div className=""&gt;
          &lt;SearchBar getCountry={this.getCountry} /&gt; &lt;br/&gt;
          &lt;Results country={this.props.country}/&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  } else { return (
      &lt;div className="search"&gt;
        &lt;div className=""&gt;
          &lt;SearchBar getCountry={this.getCountry} /&gt; &lt;br/&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  )}
  </code></pre>
  
  <p>}
  }</p>
  
  <p>In my test, I'm trying to pass the this.props.fetched into the wrapper to test that  shows up after fetched=true. Right now this is my test:</p>
  
  <pre><code>it('renders results after search', () =&gt; {
    const fetched = true;
    const wrapper = shallow(&lt;Search store={store} {...fetched}/&gt;);
    expect(wrapper.find('Results').length).toEqual(1);
  });
  </code></pre>
  
  <p>But my test keeps failing, so I must not be passing props in. What is the proper way to do this? Thanks!</p>