title: TypeError: Cannot read property 'scrollIntoView' of null - react. jest enzyme
body: <p>Using react 16.3.1, jest 16.3.1, enzyme 3.3.0.</p>
  
  <p>Within my React Class component I have created a react ref which I use to ensure that when the component is mounted the browser is at the top of the page.</p>
  
  <pre><code>class PageView extends React.Component {
  
    constructor(props) {
      super(props);
      this.topOfPageRef = React.createRef();
    }
  
    componentDidMount() {
      ReactDOM.findDOMNode(this.topOfPageRef.current).scrollIntoView();
    }
  
    render(){
      const { x } = this.props;
  
      return (
        &lt;React.Fragment&gt;
          &lt;div className="main-wrapper" ref={this.topOfPageRef}&gt;
           Top
          &lt;/div&gt;
          )}
        &lt;/React.Fragment&gt;
      );
    }
  }
  </code></pre>
  
  <p>This all works perfectly within the browser but fails in my enzyme test.</p>
  
  <p>My test is simple, it just tries to render the component.</p>
  
  <pre><code>  it('should render component correctly', () =&gt; {
      const props = {
        ...defaultProps,
      };
      const wrapper = mount(&lt;PageView {...props} /&gt;);
      expect(wrapper).toMatchSnapshot();
    });
  </code></pre>
  
  <p><code>TypeError: Cannot read property 'scrollIntoView' of null</code> </p>
  
  <p>I have tried both <strong>shallow</strong> and <strong>mount</strong> methods and whilst the element found is not null, it appears to be a react instance of HTMLDivElement which is missing the scrollIntoView method.</p>