title: Enzyme Test React.createRef()
body: <p>I have a commponent where I use the new <code>React.createRef()</code> api, how to test <code>document.activeElement</code> should be equal current ref commponent.</p>
  <p>component :</p>
  <pre class="lang-js prettyprint-override"><code>export class Automatic extends Component {
      componentDidMount = () =&gt; this.focusContainer()
      componentDidUpdate = () =&gt; this.focusContainer()
  
      container = React.createRef()
      focusContainer = () =&gt; this.container.current.focus()
  
      render = () =&gt; {
          return (
              &lt;div
                  name='automatic'
                  onKeyPress={this.captureInput}
                  onBlur={() =&gt; setTimeout(() =&gt; this.focusContainer(), 0)}
                  ref={this.container}
                  tabIndex={0}
              &gt;
                 ...
              &lt;/div&gt;
  }
  </code></pre>
  <p>old testing (works):</p>
  <pre class="lang-js prettyprint-override"><code>it('should focus container on mount', () =&gt; {
      automatic = mount(&lt;Automatic classes={{}} /&gt;, mountContext)
  
      document.activeElement.should.be.equal(automatic.ref('container'))
  })
  </code></pre>
  <p>new one (doesn't work):</p>
  <pre class="lang-js prettyprint-override"><code>it.only('should focus container on mount', () =&gt; {
      const container = React.createRef()
      automatic = mount(&lt;Automatic classes={{}} /&gt;, mountContext)
  
      document.activeElement.should.be.equal(automatic.ref(container.current))
  })
  </code></pre>