title: Testing react component methods with HOC
body: <p>As in the topic I would like to test react component methods that have HOC.</p>
  <p>Usually I did it this way:</p>
  <pre class="lang-js prettyprint-override"><code>describe('component method', () =&gt; {
    it('returns with null or undefined value', () =&gt; {
      const wrapper = shallow(&lt;Component /&gt;);
      expect(wrapper.instance().methodName());
    });
  });
  </code></pre>
  <p>but right now I have component that needs store so I am trying to do it this way:</p>
  <pre class="lang-js prettyprint-override"><code>describe('component method', () =&gt; {
    it('returns with null or undefined value', () =&gt; {
      const wrapper = shallow(&lt;Component store={store} /&gt;);
      expect(wrapper.instance().methodName());
    });
  });
  </code></pre>
  <p>of course store is defined:</p>
  <pre class="lang-js prettyprint-override"><code>const mockStore = configureMockStore();
  let store;
  </code></pre>
  <p>but I get error</p>
  <pre><code>TypeError: wrapper.instance().methodName is not a function
  </code></pre>
  <p>Could it be because my component is wrapped like this?</p>
  <pre class="lang-js prettyprint-override"><code>export default withSocket(Component);
  </code></pre>
  <p>If yes how can I solve it?</p>