Commit 466d3efd authored by Sarah GP's avatar Sarah GP

Update specs for etag path

parent 93615feb
...@@ -19,7 +19,9 @@ export default { ...@@ -19,7 +19,9 @@ export default {
type: Object, type: Object,
required: true, required: true,
validator(value) { validator(value) {
return Object.keys(value).includes('graphqlResourceEtag'); return (
Object.keys(value).includes('graphqlResourceEtag') && value.graphqlResourceEtag.length > 0
);
}, },
}, },
pipeline: { pipeline: {
......
...@@ -9,6 +9,8 @@ import PipelineGraphWrapper from '~/pipelines/components/graph/graph_component_w ...@@ -9,6 +9,8 @@ import PipelineGraphWrapper from '~/pipelines/components/graph/graph_component_w
import { mockPipelineResponse } from './mock_data'; import { mockPipelineResponse } from './mock_data';
const defaultProvide = { const defaultProvide = {
graphqlResourceEtag: 'frog/amphibirama/etag/',
metricsPath: '',
pipelineProjectPath: 'frog/amphibirama', pipelineProjectPath: 'frog/amphibirama',
pipelineIid: '22', pipelineIid: '22',
}; };
...@@ -87,6 +89,13 @@ describe('Pipeline graph wrapper', () => { ...@@ -87,6 +89,13 @@ describe('Pipeline graph wrapper', () => {
it('displays the graph', () => { it('displays the graph', () => {
expect(getGraph().exists()).toBe(true); expect(getGraph().exists()).toBe(true);
}); });
it('passes the etag resource and metrics path to the graph', () => {
expect(getGraph().props('configPaths')).toMatchObject({
graphqlResourceEtag: defaultProvide.graphqlResourceEtag,
metricsPath: defaultProvide.metricsPath,
});
});
}); });
describe('when there is an error', () => { describe('when there is an error', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment