File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -202,5 +202,30 @@ describe('React', () => {
202
202
) ;
203
203
} ) . toThrow ( / s e l e c t / ) ;
204
204
} ) ;
205
+
206
+ it ( 'does not throw error when `renderToString` is called on server' , ( ) => {
207
+ const { renderToString } = React ;
208
+ const redux = createRedux ( { string : stringBuilder } ) ;
209
+ class TestComp extends Component {
210
+ componentWillMount ( ) {
211
+ // simulate response action on data returning
212
+ redux . dispatch ( { type : 'APPEND' , body : 'a' } ) ;
213
+ }
214
+ render ( ) {
215
+ return ( < div > { this . props . string } </ div > ) ;
216
+ }
217
+ }
218
+ const el = (
219
+ < Provider redux = { redux } >
220
+ { ( ) => (
221
+ < Connector select = { state => ( { string : state . string } ) } >
222
+ { ( { string } ) => < TestComp string = { string } /> }
223
+ </ Connector >
224
+ ) }
225
+ </ Provider >
226
+ ) ;
227
+ expect ( ( ) => renderToString ( el ) ) . toNotThrow ( ) ;
228
+
229
+ } ) ;
205
230
} ) ;
206
231
} ) ;
You can’t perform that action at this time.
0 commit comments