Skip to content

Commit

Permalink
Ran lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenna Kumar authored and Jenna Kumar committed Jan 21, 2020
1 parent 3cf0257 commit 7bd0df8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/RouteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class RouteViewErrorBoundary extends Component {
const {errorMessage, errorStyle, errorViewComponent, errorViewComponentProps, ...passThroughProps } = this.props;
if (this.state.hasError) {
if (errorViewComponent) {
return createElement(errorViewComponent, errorViewComponentProps)
return createElement(errorViewComponent, errorViewComponentProps);
}
return <h1 style={errorStyle}>{errorMessage}</h1>
return <h1 style={errorStyle}>{errorMessage}</h1>;
}
return <RouteView {...passThroughProps} />;
}
Expand Down
8 changes: 6 additions & 2 deletions test/RouteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {mount} from 'enzyme';
import {mobxPlugin, RouterStore} from 'mobx-router5';
import {createTestRouter} from './utils/test-utils';
import RouteView from '../src/modules/RouteView';
import PropTypes from 'prop-types';

describe('routeNode hoc', () => {
let router;
Expand Down Expand Up @@ -91,10 +92,13 @@ describe('routeNode hoc', () => {

test('should render a custom component when an exception occurs', () => {
const route = { name: 'd.h.l' }; // A route without component
const errorViewComponent = (props) => <div style={{color: 'rgb(0, 0, 0)'}}>{props.message}</div>
const errorViewComponent = (props) => <div style={{color: 'rgb(0, 0, 0)'}}>{props.message}</div>;
errorViewComponent.propTypes = {
message: PropTypes.string
};

const RouteComp = (props) => (
<RouteView routes={routes} route={route} routeNodeName="d.h" errorMessage={''} errorViewComponent={errorViewComponent} errorViewComponentProps={{message : "My custom component"}} />
<RouteView routes={routes} route={route} routeNodeName="d.h" errorMessage={''} errorViewComponent={errorViewComponent} errorViewComponentProps={{message : 'My custom component'}} />
);

const renderedL = mount(
Expand Down

0 comments on commit 7bd0df8

Please sign in to comment.