title: Testing window.location.href in React unit tests using Mocha, Karma
body: <p>I have a simple react component where I have an onClick event which redirects to another page - the Google search engine (for testing purposes). </p>
  
  <p>Here's the JSFiddle link for the React component - <a href="http://jsfiddle.net/t9dva2f7/" rel="nofollow">http://jsfiddle.net/t9dva2f7/</a></p>
  
  <pre><code>describe('Events', function () {
      it('should have click event state', function (done) {
          var events = Events();
          ReactTestUtils.renderIntoDocument(events);
          ReactTestUtils.Simulate.click(events.refs.button.getDOMNode());
          //Test to see if the page redirects to correct url?
          done();
      });
  });
  </code></pre>
  
  <p>How can I test that the browser was redirected to the correct url? Should I be mocking window.location.href? Or is there something else ?</p>