diff --git a/test/components/connect.spec.js b/test/components/connect.spec.js
index a5c1fdece..6c3b66324 100644
--- a/test/components/connect.spec.js
+++ b/test/components/connect.spec.js
@@ -1147,5 +1147,38 @@ describe('React', () => {
wrapper.setState({ value: 1 });
expect(target.props.statefulValue).toEqual(1);
});
+
+ it('should not render the wrapped component when mapState does not produce change', () => {
+ const store = createStore(stringBuilder);
+ let renderCalls = 0;
+ let mapStateCalls = 0;
+
+ @connect(() => {
+ mapStateCalls++;
+ return {}; // no change!
+ })
+ class Container extends Component {
+ render() {
+ renderCalls++;
+ return ;
+ }
+ }
+
+ TestUtils.renderIntoDocument(
+
+
+
+ );
+
+ expect(renderCalls).toBe(1);
+ expect(mapStateCalls).toBe(1);
+
+ store.dispatch({ type: 'APPEND', body: 'a'});
+
+ // After store a change mapState has been called
+ expect(mapStateCalls).toBe(2);
+ // But render is not because it did not make any actual changes
+ expect(renderCalls).toBe(1);
+ });
});
});