Skip to content

Commit 6ad378b

Browse files
committed
Failing test in <StrictMode>
1 parent 7b4e162 commit 6ad378b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/components/connect.spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,5 +2323,27 @@ describe('React', () => {
23232323
expect(mapStateToPropsC).toHaveBeenCalledTimes(2)
23242324
expect(mapStateToPropsD).toHaveBeenCalledTimes(2)
23252325
})
2326+
2327+
it('works in <StrictMode> without warnings', () => {
2328+
const spy = jest.spyOn(console, 'error').mockImplementation(() => {})
2329+
const store = createStore(stringBuilder)
2330+
2331+
@connect(state => ({ string: state }) )
2332+
class Container extends Component {
2333+
render() {
2334+
return <Passthrough {...this.props}/>
2335+
}
2336+
}
2337+
2338+
TestRenderer.create(
2339+
<React.StrictMode>
2340+
<ProviderMock store={store}>
2341+
<Container />
2342+
</ProviderMock>
2343+
</React.StrictMode>
2344+
)
2345+
2346+
expect(spy).not.toHaveBeenCalled()
2347+
})
23262348
})
23272349
})

0 commit comments

Comments
 (0)