title: React, Jest, Enzyme how to pass test App.js with store redux
body: <p>Created a simple app using <code>create-react-app</code> then updated my App.js and added redux/store.</p>
  
  <pre><code>class App extends Component {
  
    render() {
  
      return (
        &lt;header className="header"&gt;
          &lt;h1&gt;todos&lt;/h1&gt;
        &lt;/header&gt;
      );
    }
  }
  
  function mapStateToProps(state) {
    return {
      data: state.data
    };
  }
  
  function mapDispatchToProps(dispatch) {
    return bindActionCreators(ActionCreators, dispatch);
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(App);
  </code></pre>
  
  <p>then trying to test my App on App.test.js using Enzyme and Jest.</p>
  
  <pre><code>import React from 'react'
  import Enzyme, { mount } from 'enzyme'
  import Adapter from 'enzyme-adapter-react-16';
  import App from './App'
  
  Enzyme.configure({ adapter: new Adapter() });
  
  function setup() {
    const props = {
      addTodo: jest.fn()
    }
  
    const enzymeWrapper = mount(&lt;App {...props} /&gt;)
  
    return {
      props,
      enzymeWrapper
    }
  }
  
  describe('components', () =&gt; {
    describe('App', () =&gt; {
      it('should render self and subcomponents', () =&gt; {
        const { enzymeWrapper } = setup()
        expect(enzymeWrapper.find('header')).toBe(true)
      })
    })
  })
  </code></pre>
  
  <p>but throwing error: Invariant Violation: Could not find "store" in either the context or props of "Connect(App)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(App)".</p>
  
  <p>Any Ideas?</p>