Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle inline taskSpec in pipeline detail page
- Loading branch information
karthik
committed
Sep 14, 2020
1 parent
e7565ea
commit fa864a9
Showing
9 changed files
with
123 additions
and
21 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
...ents/pipelines/detail-page-tabs/pipeline-details/__tests__/PipelineVisualization.spec.tsx
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,35 @@ | ||
import * as React from 'react'; | ||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
import { Alert } from '@patternfly/react-core'; | ||
import { mockPipelinesJSON } from '../../../../../utils/__tests__/pipeline-test-data'; | ||
import PipelineTopologyGraph from '../../../pipeline-topology/PipelineTopologyGraph'; | ||
import PipelineVisualization from '../PipelineVisualization'; | ||
|
||
describe('Pipeline Visualization', () => { | ||
type PipelineVisualizationProps = React.ComponentProps<typeof PipelineVisualization>; | ||
let wrapper: ShallowWrapper<PipelineVisualizationProps>; | ||
beforeEach(() => { | ||
wrapper = shallow(<PipelineVisualization pipeline={mockPipelinesJSON[2]} />); | ||
}); | ||
|
||
it('Should render a Alert message if the pipeline has inline taskSpec ', () => { | ||
const alert = wrapper.find(Alert); | ||
expect(alert).toHaveLength(1); | ||
expect(alert.props().title).toBe( | ||
'This Pipeline cannot be visualized. Pipeline taskSpec is not supported.', | ||
); | ||
}); | ||
|
||
it('Should render a Alert message if the pipeline does not have tasks', () => { | ||
wrapper.setProps({ pipeline: { ...mockPipelinesJSON[2], spec: { tasks: [] } } }); | ||
const alert = wrapper.find(Alert); | ||
expect(alert).toHaveLength(1); | ||
expect(alert.props().title).toBe('This Pipeline has no tasks to visualize.'); | ||
}); | ||
|
||
it('Should render a pipeline Visualization component', () => { | ||
wrapper.setProps({ pipeline: mockPipelinesJSON[1] }); | ||
const PipelineTopologyGraphComponent = wrapper.find(PipelineTopologyGraph); | ||
expect(PipelineTopologyGraphComponent).toHaveLength(1); | ||
}); | ||
}); |
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
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
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
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
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
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