title: Testing react redirect
body: <p>I have a react component which can result in one of two redirects being rendered, such as:</p>
  
  <pre class="lang-js prettyprint-override"><code>render () {
    if(condition) {
      return &lt;Redirect to={'page1'} /&gt;
    } else {
      return &lt;Redirect to={'page2'} /&gt;
    }
  }
  </code></pre>
  
  <p>In the enzyme test, I have found out how to test that a redirect is being rendered: </p>
  
  <pre class="lang-js prettyprint-override"><code>expect(page.find('Redirect').length).toEqual(1)
  </code></pre>
  
  <p>However I am not sure how to configure the test so that I can test which of the redirects is being rendered. According to the Enzyme <a href="https://github.com/airbnb/enzyme/blob/master/docs/api/selector.md" rel="nofollow noreferrer">find</a> docs it is not possible to use find to locate a tag along with an attribute, which leads me to believe I am going about this in the wrong way. </p>