File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2323,5 +2323,27 @@ describe('React', () => {
2323
2323
expect ( mapStateToPropsC ) . toHaveBeenCalledTimes ( 2 )
2324
2324
expect ( mapStateToPropsD ) . toHaveBeenCalledTimes ( 2 )
2325
2325
} )
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
+ } )
2326
2348
} )
2327
2349
} )
You can’t perform that action at this time.
0 commit comments