fix unit tests for network handling

This commit is contained in:
John Mitchell
2019-04-10 11:16:20 -04:00
parent ad0e409448
commit 344713f938
26 changed files with 499 additions and 344 deletions

View File

@@ -67,13 +67,13 @@ class provider extends Component {
render () {
const {
value
value: stateValue
} = this.state;
const { children } = this.props;
const { value: propsValue, children } = this.props;
return (
<ConfigContext.Provider value={value}>
<ConfigContext.Provider value={propsValue || stateValue}>
{children}
</ConfigContext.Provider>
);

View File

@@ -59,21 +59,20 @@ class prov extends Component {
render () {
const {
children
} = this.props;
const {
value
value: stateValue
} = this.state;
const { value: propsValue, children } = this.props;
return (
<NetworkContext.Provider value={value}>
<NetworkContext.Provider value={propsValue || stateValue}>
{children}
</NetworkContext.Provider>
);
}
}
export { NetworkProvider as _NetworkProvider };
export const NetworkProvider = withRootDialog(withRouter(prov));
export function withNetwork (Child) {