title: Getting props through HOC when mounting in Enzyme
body: <p>I am trying to test some code that uses firebase. I am implementing the firebase-mock library. The problem I'am encountering now is that most all the components I should test get the firebase instance from a HOC (I have a class with the firebase methods I am using that is provided through the context API in the index.js and consumed via a withFirebase HOC, the wrapped component will have firebase in its props).</p>
  
  <p>In this case the code I am trying to test is the following:</p>
  
  <pre><code>// mount.js
  
  import React, { Component } from 'react';
  import { withFirebase } from '../../components/Firebase';
  
  class mount extends Component {
    state = {
      data: null,
    };
  
    ref = this.props.firebase.db.ref('/testing');
  
    componentDidMount() {
      // Fetch from testing ref
  
      this.ref.on('value', snap =&gt; {
        this.setState({ data: snap });
      });
    }
  
    componentWillUnmount() {
      this.ref.off('value');
    }
  
    render() {
      return &lt;div /&gt;;
    }
  }
  
  export default withFirebase(mount);
  
  </code></pre>
  
  <p>In my test file I'm doing the following:</p>
  
  <pre><code>describe('Component mount.js', () =&gt; {
    it.only('fetches', () =&gt; {
      const wrapper = mount(&lt;Mount /&gt;);
      console.log(wrapper.prop());
      console.log(wrapper.state().data);
    });
  });
  
  </code></pre>
  
  <p>This fails because this.props.firebase is null.
  How could I solve this so that I can continue and finally mock firebase calls as i was intending.
  I'm guessing that the problem is how to use the Context API in Enzyme, but I'm not sure.</p>