Skip to content

Commit 3d6e8f7

Browse files
committed
test added
1 parent fadd914 commit 3d6e8f7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/components/Connector.spec.js

+25
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,30 @@ describe('React', () => {
202202
);
203203
}).toThrow(/select/);
204204
});
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+
});
205230
});
206231
});

0 commit comments

Comments
 (0)