title: Simulate history.back() in enzyme
body: <p>For a react component test i need to simulate a browser back. Is this possible with a mounted component?</p>
  
  <p>What i've tried:</p>
  
  <pre class="lang-js prettyprint-override"><code>it('triggers onpopstate events', () =&gt; {
     requiredProps.filterBlocks = mockData.filterBlocks;
  
     const wrapper = mount(&lt;FilterBlocks {...requiredProps} /&gt;);
  
     global.window.history.pushState({ mock: 'MOCK'}, "mock", "mock.html");
     global.window.history.pushState({ mock: 'MOCK2'}, "mock", "mock2.html");
  
     global.window.history.back();
  
  
     expect(mockedFunction).toHaveBeenCalled();
  })
  </code></pre>
  
  
  
  <p>Inside the component (componentDidMount) i have a window.onpopstate listener:</p>
  
  <pre class="lang-js prettyprint-override"><code>window.onpopstate = event =&gt; {
      console.log('event', event);
  };
  </code></pre>
  
  
  
  <p>But nothing will be logged to console.</p>