diff --git a/test/components/connect.spec.js b/test/components/connect.spec.js index 8af12bb2b..614ae4743 100644 --- a/test/components/connect.spec.js +++ b/test/components/connect.spec.js @@ -1148,5 +1148,51 @@ describe('React', () => { wrapper.setState({ value: 1 }); expect(target.props.statefulValue).toEqual(1); }); + + it('should not pass stale data to mapState', () => { + const store = createStore(stringBuilder); + store.dispatch({ type: 'APPEND', body: 'initial'}); + let childMapStateExecuted = false; + + @connect(state => ({ string: state }) ) + class Container extends Component { + + emitChange() { + store.dispatch({ type: 'APPEND', body: 'changed'}); + } + + render() { + return ( +