title: testing click behavior on React Router Links with Enzyme
body: <p>While I'm ultimately trying to write an Enzyme test for  the flow in this react router example: <a href="https://reacttraining.com/react-router/web/example/auth-workflow" rel="noreferrer">https://reacttraining.com/react-router/web/example/auth-workflow</a> </p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import Enzyme, { shallow, mount } from 'enzyme';
  import Adapter from 'enzyme-adapter-react-16';
  import { MemoryRouter, Route, Switch, Link } from 'react-router-dom';
  
  const Home = () =&gt; &lt;div&gt;Home&lt;/div&gt;;
  const MockComp = () =&gt; (
    &lt;div className="protected"&gt;
      &lt;nav&gt;hi&lt;/nav&gt;
      Protected
    &lt;/div&gt;
  );
  const MockDenied = () =&gt; &lt;div className="denied"&gt;Denied&lt;/div&gt;;
  
  test('Renders visited protected component if authorized', () =&gt; {
    const wrapper = mount(
      &lt;MemoryRouter initialEntries={['/']}&gt;
        &lt;div&gt;
          &lt;Link to="/foo" /&gt;
          &lt;Switch&gt;
            &lt;Route path="/" component={Home} /&gt;
            &lt;Route path="/401" component={MockDenied} /&gt;
            &lt;ProtectedRouteBasic
              path="/foo"
              auth={{ hasAuth: true }}
              component={MockComp}
            /&gt;
          &lt;/Switch&gt;
        &lt;/div&gt;
      &lt;/MemoryRouter&gt;
    );
    wrapper.find('a').simulate('click', { button: 0 });
    expect(wrapper.find('.protected').length).toEqual(1);
    expect(wrapper.find('.denied').length).toEqual(0);
  });
  </code></pre>
  
  <p>I've found a number of issues and have tried to peel away the complexity and then slowly reintroduce the elements that I've removed.  </p>
  
  <p>So I've landed on this test as what I will need to get working to proceed:</p>
  
  <pre><code>test('Clicking link will render component associated with path', () =&gt; {
    const wrapper = mount(
      &lt;MemoryRouter&gt;
        &lt;div&gt;
          &lt;Link to="/foo" /&gt;
          &lt;Switch&gt;
            &lt;Route path="/" component={Home} /&gt;
            &lt;Route path="/foo" component={MockComp} /&gt;
          &lt;/Switch&gt;
        &lt;/div&gt;
      &lt;/MemoryRouter&gt;
    );
    wrapper.find('a').simulate('click', { button: 0 });
    expect(wrapper.find('.protected')).toHaveLength(1);
  });
  </code></pre>
  
  <p>However, this test isn't working as expected as I expect the test to pass in its current state.  I've read <a href="https://stackoverflow.com/questions/46651092/enzyme-integration-testing-testing-with-react-router-testing-components-update">this thread</a> to update my <code>simulate</code> call to include the <code>{button: 0}</code> as well as <a href="https://stackoverflow.com/questions/41531465/how-to-test-react-router-with-enzyme">this thread</a> about wrapping the entire router in a functional component, however, that option's not available to me as far as I know, since the <a href="http://fusionjs.com" rel="noreferrer">framework I'm working with</a> doesn't seem to allow for it.  Additionally, I believe that that piece is immaterial to the issue I'm having.  That said, any help would be much appreciated.</p>