Commit 520c2817 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Fix conflicts for:

- app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
- spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
parent 517f4257
......@@ -2,10 +2,7 @@
import pipelineStage from '../../pipelines/components/stage.vue';
import ciIcon from '../../vue_shared/components/ci_icon.vue';
import icon from '../../vue_shared/components/icon.vue';
<<<<<<< HEAD
import linkedPipelinesMiniList from '../../vue_shared/components/linked_pipelines_mini_list.vue';
=======
>>>>>>> ce/master
export default {
name: 'MRWidgetPipeline',
......@@ -29,10 +26,7 @@
pipelineStage,
ciIcon,
icon,
<<<<<<< HEAD
linkedPipelinesMiniList,
=======
>>>>>>> ce/master
},
computed: {
hasPipeline() {
......@@ -50,7 +44,6 @@
this.pipeline.details.stages &&
this.pipeline.details.stages.length;
},
<<<<<<< HEAD
/* We typically set defaults ([]) in the store or prop declarations, but because triggered
* and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we
......@@ -66,12 +59,6 @@
},
};
</script>
=======
},
};
</script>
>>>>>>> ce/master
<template>
<div
v-if="hasPipeline || hasCIError"
......@@ -79,12 +66,7 @@
<div class="ci-widget media">
<template v-if="hasCIError">
<div class="ci-status-icon ci-status-icon-failed ci-error js-ci-error append-right-10">
<<<<<<< HEAD
<icon
name="status_failed"/>
=======
<icon name="status_failed" />
>>>>>>> ce/master
</div>
<div class="media-body">
Could not connect to the CI server. Please check your settings and try again
......@@ -96,10 +78,6 @@
:href="this.status.details_path">
<ci-icon :status="status" />
</a>
<<<<<<< HEAD
=======
>>>>>>> ce/master
<div class="media-body">
Pipeline
<a
......@@ -107,13 +85,9 @@
class="pipeline-id">
#{{pipeline.id}}
</a>
<<<<<<< HEAD
{{pipeline.details.status.label}} for
=======
{{pipeline.details.status.label}} for
>>>>>>> ce/master
<a
:href="pipeline.commit.commit_path"
class="commit-sha js-commit-link">
......@@ -121,19 +95,15 @@
<span class="mr-widget-pipeline-graph">
<span class="stage-cell">
<<<<<<< HEAD
<linked-pipelines-mini-list
v-if="triggeredBy.length"
:triggered-by="triggeredBy"
/>
=======
>>>>>>> ce/master
<div
v-if="hasStages"
v-for="(stage, i) in pipeline.details.stages"
:key="i"
<<<<<<< HEAD
class="stage-container dropdown js-mini-pipeline-graph"
:class="{
'has-downstream': i === pipeline.details.stages.length - 1 && triggered.length
......@@ -145,11 +115,6 @@
v-if="triggered.length"
:triggered="triggered"
/>
=======
class="stage-container dropdown js-mini-pipeline-graph">
<pipeline-stage :stage="stage" />
</div>
>>>>>>> ce/master
</span>
</span>
......
import Vue from 'vue';
import pipelineComponent from '~/vue_merge_request_widget/components/mr_widget_pipeline.vue';
<<<<<<< HEAD
import mockData from '../mock_data';
import mockLinkedPipelines from '../../pipelines/graph/linked_pipelines_mock_data';
import mountComponent from '../../helpers/vue_mount_component_helper';
=======
import mountComponent from '../../helpers/vue_mount_component_helper';
import mockData from '../mock_data';
>>>>>>> ce/master
describe('MRWidgetPipeline', () => {
let vm;
......@@ -72,7 +67,6 @@ describe('MRWidgetPipeline', () => {
hasCi: true,
ciStatus: null,
});
<<<<<<< HEAD
expect(
vm.$el.querySelector('.media-body').textContent.trim(),
......@@ -117,44 +111,9 @@ describe('MRWidgetPipeline', () => {
expect(
vm.$el.querySelector('.media-body').textContent,
).toContain(`Coverage ${mockData.pipeline.coverage}`);
=======
expect(
vm.$el.querySelector('.media-body').textContent.trim(),
).toEqual('Could not connect to the CI server. Please check your settings and try again');
});
describe('with a pipeline', () => {
beforeEach(() => {
vm = mountComponent(Component, {
pipeline: mockData.pipeline,
hasCi: true,
ciStatus: 'success',
});
});
it('should render pipeline ID', () => {
expect(
vm.$el.querySelector('.pipeline-id').textContent.trim(),
).toEqual(`#${mockData.pipeline.id}`);
});
it('should render pipeline status and commit id', () => {
expect(
vm.$el.querySelector('.media-body').textContent.trim(),
).toContain(mockData.pipeline.details.status.label);
expect(
vm.$el.querySelector('.js-commit-link').textContent.trim(),
).toEqual(mockData.pipeline.commit.short_id);
expect(
vm.$el.querySelector('.js-commit-link').getAttribute('href'),
).toEqual(mockData.pipeline.commit.commit_path);
>>>>>>> ce/master
});
});
<<<<<<< HEAD
describe('without coverage', () => {
it('should not render a coverage', () => {
const mockCopy = Object.assign({}, mockData);
......@@ -184,86 +143,43 @@ describe('MRWidgetPipeline', () => {
});
expect(vm.$el.querySelector('.js-mini-pipeline-graph')).toEqual(null);
=======
it('should render pipeline graph', () => {
expect(vm.$el.querySelector('.mr-widget-pipeline-graph')).toBeDefined();
expect(vm.$el.querySelectorAll('.stage-container').length).toEqual(mockData.pipeline.details.stages.length);
});
it('should render coverage information', () => {
expect(
vm.$el.querySelector('.media-body').textContent,
).toContain(`Coverage ${mockData.pipeline.coverage}`);
});
});
describe('without coverage', () => {
it('should not render a coverage', () => {
const mockCopy = Object.assign({}, mockData);
delete mockCopy.pipeline.coverage;
describe('when upstream pipelines are passed', () => {
beforeEach(() => {
vm = mountComponent(Component, {
pipeline: mockCopy.pipeline,
pipeline: Object.assign({}, mockData.pipeline, {
triggered_by: mockLinkedPipelines.triggered_by,
}),
hasCi: true,
ciStatus: 'success',
});
expect(
vm.$el.querySelector('.media-body').textContent,
).not.toContain('Coverage');
>>>>>>> ce/master
});
});
});
<<<<<<< HEAD
describe('when upstream pipelines are passed', () => {
beforeEach(() => {
vm = mountComponent(Component, {
pipeline: Object.assign({}, mockData.pipeline, {
triggered_by: mockLinkedPipelines.triggered_by,
}),
hasCi: true,
ciStatus: 'success',
it('should coerce triggeredBy into a collection', () => {
expect(vm.triggeredBy.length).toBe(1);
});
});
it('should coerce triggeredBy into a collection', () => {
expect(vm.triggeredBy.length).toBe(1);
});
it('should render the linked pipelines mini list', () => {
expect(vm.$el.querySelector('.linked-pipeline-mini-list.is-upstream')).not.toBeNull();
it('should render the linked pipelines mini list', () => {
expect(vm.$el.querySelector('.linked-pipeline-mini-list.is-upstream')).not.toBeNull();
});
});
});
describe('when downstream pipelines are passed', () => {
beforeEach(() => {
vm = mountComponent(Component, {
pipeline: Object.assign({}, mockData.pipeline, {
triggered: mockLinkedPipelines.triggered,
}),
hasCi: true,
ciStatus: 'success',
=======
describe('without a pipeline graph', () => {
it('should not render a pipeline graph', () => {
const mockCopy = Object.assign({}, mockData);
delete mockCopy.pipeline.details.stages;
describe('when downstream pipelines are passed', () => {
beforeEach(() => {
vm = mountComponent(Component, {
pipeline: mockCopy.pipeline,
pipeline: Object.assign({}, mockData.pipeline, {
triggered: mockLinkedPipelines.triggered,
}),
hasCi: true,
ciStatus: 'success',
});
expect(vm.$el.querySelector('.js-mini-pipeline-graph')).toEqual(null);
>>>>>>> ce/master
});
});
it('should render the linked pipelines mini list', () => {
expect(vm.$el.querySelector('.linked-pipeline-mini-list.is-downstream')).not.toBeNull();
it('should render the linked pipelines mini list', () => {
expect(vm.$el.querySelector('.linked-pipeline-mini-list.is-downstream')).not.toBeNull();
});
});
});
});
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