title: Testing Connected Container methods in Jest + Enzyme
body: <p>I have a connected container like so:</p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  import { bindActionCreators } from 'redux';
  import { connect } from 'react-redux';
  import { autobind } from 'core-decorators';
  
  const propTypes = {
    data: PropTypes.object,
    userData: PropTypes.object,
  };
  
  class ConnectedContainer extends React.Component {
      @autobind
      doSomethingImportant() {
        ...
      }
  
    render() {
      ....
    }
  }
  
  ConnectedContainer.propTypes = propTypes;
  
  const mapStateToProps = state =&gt; ({ data, userData });
  const mapDispatchToProps = (dispatch) =&gt; {
    return { actions: bindActionCreators(actions, dispatch) };
  };
  export default connect(mapStateToProps, mapDispatchToProps)(ConnectedContainer);
  </code></pre>
  
  <p>I want to test <code>doSomethingImportant</code>, so I have test like so:</p>
  
  <pre><code>import React from 'react';
  import { shallow } from 'enzyme';
  import ConnectedContainer from '.....'';
  import configureStore from 'redux-mock-store';
  
  const mockStore = configureStore();
  const store = mockStore({ getState: () =&gt; null, dispatch: () =&gt; null, data: { data from fixture }, userData: { data from fixture } });
  const container = (
    &lt;ConnectedContainer
      store={store}
      actions={{}}
    /&gt;
  );
  
  describe('ConnectedContainer', () =&gt; {
    describe('doSomethingImportant', () =&gt; {
      it('returns something important', () =&gt; {
        const wrapper = shallow(container);
        expect(wrapper.instance().doSomethingImportant()).to.equal( ... some output here );
      });
    });
  });
  </code></pre>
  
  <p>And no matter what I do, I get this error:</p>
  
  <pre><code>TypeError: wrapper.instance(...). doSomethingImportant is not a function
  </code></pre>
  
  <p>What is happening with my container that I'm unable to access its instance methods?</p>