Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test depending on Graylog minor version. #5671

Merged
merged 2 commits into from Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion graylog2-web-interface/src/routing/AppErrorBoundary.test.jsx
Expand Up @@ -85,7 +85,13 @@ describe('AppErrorBoundary', () => {
</AppErrorBoundary>
));

expect(wrapper).toMatchSnapshot();
const errorPage = wrapper.find('ErrorPage');
expect(errorPage).toExist();
expect(errorPage).toHaveProp('error', {
message: 'Oh no, a banana peel fell on the party gorilla\'s head!',
stack: 'This the stack trace.',
});
expect(errorPage).toHaveProp('info', { componentStack: '\n in ErroneusComponent\n in AppErrorBoundary (created by WrapperComponent)\n in WrapperComponent' });
});
});

Expand Down
Expand Up @@ -27,284 +27,3 @@ exports[`AppErrorBoundary displays child component if there is no error 1`] = `
</WorkingComponent>
</AppErrorBoundary>
`;

exports[`AppErrorBoundary displays error after catching 1`] = `
<AppErrorBoundary
router={
Object {
"listen": [MockFunction] {
"calls": Array [
Array [
[Function],
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
],
},
}
}
>
<ErrorPage
error={
Object {
"message": "Oh no, a banana peel fell on the party gorilla's head!",
"stack": "This the stack trace.",
}
}
info={
Object {
"componentStack": "
in ErroneusComponent
in AppErrorBoundary (created by WrapperComponent)
in WrapperComponent",
}
}
>
<div
className="container-fluid"
>
<DocumentTitle
title="Something went wrong."
>
<Row
bsClass="row"
className="jumbotron-container"
componentClass="div"
>
<div
className="jumbotron-container row"
>
<Col
bsClass="col"
componentClass="div"
md={8}
mdOffset={2}
>
<div
className="col-md-8 col-md-offset-2"
>
<Jumbotron
bsClass="jumbotron"
componentClass="div"
>
<div
className="jumbotron"
>
<h1>
Something went wrong.
</h1>
<p>
It seems like the page you navigated to contained an error.
</p>
<p>
You can use the navigation to reach other parts of the product, refresh the page or submit an error report.
</p>
<div>
<div
className="content"
style={
Object {
"padding": "2em",
}
}
>
<SupportSources>
<div
className="support-sources"
>
<h2>
Need help?
</h2>
<p>
Do not hesitate to consult the Graylog community if your questions are not answered in the

<DocumentationLink
page=""
text="documentation"
>
<a
href="http://docs.graylog.org/en/3.0"
target="_blank"
>
documentation
</a>
</DocumentationLink>
.
</p>
<ul>
<li>
<i
className="fa fa-group"
/>

<a
href="https://www.graylog.org/community-support/"
rel="noopener noreferrer"
target="_blank"
>
Community support
</a>
</li>
<li>
<i
className="fa fa-github-alt"
/>

<a
href="https://github.com/Graylog2/graylog2-server/issues"
rel="noopener noreferrer"
target="_blank"
>
Issue tracker
</a>
</li>
<li>
<i
className="fa fa-heart"
/>

<a
href="https://www.graylog.org/professional-support"
rel="noopener noreferrer"
target="_blank"
>
Professional support
</a>
</li>
</ul>
</div>
</SupportSources>
</div>
<dl>
<dt>
Error:
<div
className="pull-right undefined"
>
<a
href="#"
onClick={[Function]}
tabIndex={0}
>
Show more
</a>
</div>
</dt>
<dd>
<pre
className="content"
>
<div
className="pull-right"
>
<ClipboardButton
action="copy"
bsSize="sm"
buttonTitle="Copy error details to clipboard"
disabled={false}
text="Oh no, a banana peel fell on the party gorilla's head!


Stack Trace:

This the stack trace.

Component Stack:

in ErroneusComponent
in AppErrorBoundary (created by WrapperComponent)
in WrapperComponent"
title={
<i
className="fa fa-copy fa-fw"
/>
}
>
<OverlayTrigger
defaultOverlayShown={false}
overlay={
<Tooltip
bsClass="tooltip"
id="copy-button-tooltip"
placement="right"
>

</Tooltip>
}
placement="top"
rootClose={true}
trigger="click"
>
<Button
active={false}
block={false}
bsClass="btn"
bsSize="sm"
bsStyle="default"
data-clipboard-action="copy"
data-clipboard-button={true}
data-clipboard-text="Oh no, a banana peel fell on the party gorilla's head!


Stack Trace:

This the stack trace.

Component Stack:

in ErroneusComponent
in AppErrorBoundary (created by WrapperComponent)
in WrapperComponent"
disabled={false}
onClick={[Function]}
title="Copy error details to clipboard"
>
<button
className="btn btn-sm btn-default"
data-clipboard-action="copy"
data-clipboard-button={true}
data-clipboard-text="Oh no, a banana peel fell on the party gorilla's head!


Stack Trace:

This the stack trace.

Component Stack:

in ErroneusComponent
in AppErrorBoundary (created by WrapperComponent)
in WrapperComponent"
disabled={false}
onClick={[Function]}
title="Copy error details to clipboard"
type="button"
>
<i
className="fa fa-copy fa-fw"
/>
</button>
</Button>
</OverlayTrigger>
</ClipboardButton>
</div>
Oh no, a banana peel fell on the party gorilla's head!
</pre>
</dd>
</dl>
</div>
</div>
</Jumbotron>
</div>
</Col>
</div>
</Row>
</DocumentTitle>
</div>
</ErrorPage>
</AppErrorBoundary>
`;