title: How to test a connected component wrapped in another connected component?
body: <p>I want to test my pure component so I'm doing this:</p>
  
  <p>MyComp.js</p>
  
  <pre><code>export MyComp = props =&gt; {
    return (
      &lt;Wrapper&gt;Content&lt;/Wrapper&gt;
    )
  }
  
  const MyCompConn = connect()(MyComp);
  export default MyCompConn;
  </code></pre>
  
  <p>Where <code>&lt;Wrapper&gt;</code>:</p>
  
  <pre><code>export Wrapper = ({children}) =&gt; {
    return (
      &lt;div&gt;{children}&lt;/div&gt;
    )
  }
  
  const WrapperConn = connect()(Wrapper);
  export default WrapperConn;
  </code></pre>
  
  <p>MyComp.test.js</p>
  
  <pre><code>import React from 'react';
  import renderer from 'react-test-renderer';
  
  import { MyComp } from '../../MyComp';
  
  
  describe('With Snapshot Testing', () =&gt; {
    it('renders!"', () =&gt; {
      const component = renderer.create(&lt;Login /&gt;);
      const tree = component.toJSON();
      expect(tree).toMatchSnapshot();
    });
  });
  </code></pre>
  
  <p>Now, when I run <code>yarn test</code> I get this error:</p>
  
  <p><code>Invariant Violation: Could not find "store" in either the context or props of "Connect(AppWrapper)". Either wrap the root component in a &lt;Provider&gt; or explicitly pass "store" as a prop to "Connect(AppWrapper)"</code></p>
  
  <p>And this is happening because <code>&lt;Wrapper&gt;</code> is connected in my <code>&lt;MyComp&gt;</code> component, but I'm not sure how to test <strong>just</strong> the latter even if it's wrapped on a connected component.</p>