-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PipelineViewer] Test PipelineViewer sub-components (#20329)
* Rename config view to PipelineViewer. * Decouple CollapsibleStatement from if/else using props.children. * Add tests for PipelineViewer component. * Test Metric component. * Test CollapsibleStatement component. * Test PluginStatement component. * Test Queue component. * Test StatementListHeading component. * Test StatementSection component. Move StatementList component to dedicated file. * Test StatementList component. * Test Statement component. * Run prettier on edited files.
- Loading branch information
1 parent
3b3dc0b
commit da2448f
Showing
26 changed files
with
1,680 additions
and
273 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.../logstash/pipeline_viewer/views/__test__/__snapshots__/collapsible_statement.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CollapsibleStatement component renders child components 1`] = ` | ||
<EuiFlexGroup | ||
alignItems="center" | ||
className="pipelineViewer__statement" | ||
component="div" | ||
direction="row" | ||
gutterSize="none" | ||
justifyContent="flexStart" | ||
responsive={false} | ||
wrap={false} | ||
> | ||
<EuiFlexItem | ||
component="div" | ||
grow={false} | ||
key="statementId" | ||
> | ||
<EuiButtonIcon | ||
aria-label={true} | ||
color="text" | ||
iconType="arrowDown" | ||
onClick={[Function]} | ||
size="s" | ||
type="button" | ||
/> | ||
</EuiFlexItem> | ||
<div> | ||
child element | ||
</div> | ||
</EuiFlexGroup> | ||
`; |
36 changes: 36 additions & 0 deletions
36
...blic/components/logstash/pipeline_viewer/views/__test__/__snapshots__/metric.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Metric component does not render warning badge when no warning present 1`] = ` | ||
<EuiFlexItem | ||
className="pipelineViewer__metricFlexItem" | ||
component="div" | ||
grow={false} | ||
> | ||
<EuiText | ||
className="pipelineViewer__metric metricClass" | ||
color="subdued" | ||
grow={true} | ||
size="s" | ||
> | ||
<span> | ||
220 | ||
</span> | ||
</EuiText> | ||
</EuiFlexItem> | ||
`; | ||
|
||
exports[`Metric component renders warning badge 1`] = ` | ||
<EuiFlexItem | ||
className="pipelineViewer__metricFlexItem" | ||
component="div" | ||
grow={false} | ||
> | ||
<EuiBadge | ||
className="metricClass" | ||
color="warning" | ||
iconSide="left" | ||
> | ||
220 | ||
</EuiBadge> | ||
</EuiFlexItem> | ||
`; |
177 changes: 177 additions & 0 deletions
177
...onents/logstash/pipeline_viewer/views/__test__/__snapshots__/pipeline_viewer.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`PipelineViewer component passes expected props 1`] = ` | ||
<EuiPage | ||
restrictWidth={false} | ||
> | ||
<EuiPageContent | ||
className="pipelineViewer" | ||
horizontalPosition="center" | ||
panelPaddingSize="l" | ||
verticalPosition="center" | ||
> | ||
<StatementSection | ||
detailVertex={null} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "standardInput", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Inputs" | ||
iconType="logstashInput" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<Queue | ||
queue={ | ||
Object { | ||
"hasExplicitId": false, | ||
"id": "__QUEUE__", | ||
"meta": null, | ||
"stats": Array [], | ||
} | ||
} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<StatementSection | ||
detailVertex={null} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "mutate", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Filters" | ||
iconType="logstashFilter" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<StatementSection | ||
detailVertex={null} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "elasticsearch", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Outputs" | ||
iconType="logstashOutput" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
</EuiPageContent> | ||
</EuiPage> | ||
`; | ||
|
||
exports[`PipelineViewer component renders DetailDrawer when selected vertex is not null 1`] = ` | ||
<EuiPage | ||
restrictWidth={false} | ||
> | ||
<EuiPageContent | ||
className="pipelineViewer" | ||
horizontalPosition="center" | ||
panelPaddingSize="l" | ||
verticalPosition="center" | ||
> | ||
<StatementSection | ||
detailVertex={ | ||
Object { | ||
"id": "stdin", | ||
} | ||
} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "standardInput", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Inputs" | ||
iconType="logstashInput" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<Queue | ||
queue={ | ||
Object { | ||
"hasExplicitId": false, | ||
"id": "__QUEUE__", | ||
"meta": null, | ||
"stats": Array [], | ||
} | ||
} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<StatementSection | ||
detailVertex={ | ||
Object { | ||
"id": "stdin", | ||
} | ||
} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "mutate", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Filters" | ||
iconType="logstashFilter" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
<EuiSpacer | ||
size="l" | ||
/> | ||
<StatementSection | ||
detailVertex={ | ||
Object { | ||
"id": "stdin", | ||
} | ||
} | ||
elements={ | ||
Array [ | ||
Object { | ||
"depth": 0, | ||
"id": "elasticsearch", | ||
"parentId": null, | ||
}, | ||
] | ||
} | ||
headingText="Outputs" | ||
iconType="logstashOutput" | ||
onShowVertexDetails={[Function]} | ||
/> | ||
<DetailDrawer | ||
onHide={[Function]} | ||
vertex={ | ||
Object { | ||
"id": "stdin", | ||
} | ||
} | ||
/> | ||
</EuiPageContent> | ||
</EuiPage> | ||
`; |
Oops, something went wrong.