Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Aug 28, 2018
1 parent ef8373b commit 85ca38d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
18 changes: 12 additions & 6 deletions packages/api-explorer/__tests__/Doc.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,21 +308,27 @@ test('should output with an error message if the endpoint fails to load', () =>
const brokenOas = {
paths: {
'/path': {
'post': {
post: {
requestBody: {
$ref: '#/components/schemas/UnknownSchema',
},
}
}
}
},
},
},
};

const doc = mount(
<Doc
{...props}
oas={brokenOas}
doc={{ title: 'title', slug: 'slug', type: 'endpoint', swagger: { path: '/path' }, api: { method: 'post' } }}
/>
doc={{
title: 'title',
slug: 'slug',
type: 'endpoint',
swagger: { path: '/path' },
api: { method: 'post' },
}}
/>,
);

doc.setState({ showEndpoint: true });
Expand Down
2 changes: 1 addition & 1 deletion packages/api-explorer/src/Doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class Doc extends React.Component {

return (
<EndpointErrorBoundary>
{ this.props.flags.stripe ? this.themeStripe(doc) : this.themeMain(doc) }
{this.props.flags.stripe ? this.themeStripe(doc) : this.themeMain(doc)}
</EndpointErrorBoundary>
);
}
Expand Down
12 changes: 9 additions & 3 deletions packages/api-explorer/src/EndpointErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@ class EndpointErrorBoundary extends React.Component {
return (
<div className="hub-reference-section">
<div className="hub-reference-left" style={{ paddingLeft: '2%' }}>
<h3>There was an error rendering this endpoint. Please contact <a href="mailto:support@readme.io?subject=API Explorer Error">support@readme.io</a> with the following error:</h3>
<h3>
There was an error rendering this endpoint. Please contact{' '}
<a href="mailto:support@readme.io?subject=API Explorer Error">
support@readme.io
</a>{' '}
with the following error:
</h3>
<pre>
{this.state.error && this.state.error.toString()}
{this.state.info.componentStack}
</pre>
</div>
<div className="hub-reference-right" />
</div>
)
);
}
return this.props.children;
}
}

EndpointErrorBoundary.propTypes = {
children: PropTypes.node.isRequired,
}
};

module.exports = EndpointErrorBoundary;

0 comments on commit 85ca38d

Please sign in to comment.