summaryrefslogtreecommitdiff
path: root/spec/frontend/pipelines/graph/stage_column_component_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pipelines/graph/stage_column_component_spec.js')
-rw-r--r--spec/frontend/pipelines/graph/stage_column_component_spec.js30
1 files changed, 19 insertions, 11 deletions
diff --git a/spec/frontend/pipelines/graph/stage_column_component_spec.js b/spec/frontend/pipelines/graph/stage_column_component_spec.js
index 16dc70a63a5..f9f6c96a1a6 100644
--- a/spec/frontend/pipelines/graph/stage_column_component_spec.js
+++ b/spec/frontend/pipelines/graph/stage_column_component_spec.js
@@ -1,7 +1,7 @@
import { mount, shallowMount } from '@vue/test-utils';
-import ActionComponent from '~/pipelines/components/graph/action_component.vue';
import JobItem from '~/pipelines/components/graph/job_item.vue';
import StageColumnComponent from '~/pipelines/components/graph/stage_column_component.vue';
+import ActionComponent from '~/pipelines/components/jobs_shared/action_component.vue';
const mockJob = {
id: 4250,
@@ -24,11 +24,11 @@ const mockJob = {
const mockGroups = Array(4)
.fill(0)
.map((item, idx) => {
- return { ...mockJob, id: idx, name: `fish-${idx}` };
+ return { ...mockJob, jobs: [mockJob], id: idx, name: `fish-${idx}` };
});
const defaultProps = {
- title: 'Fish',
+ name: 'Fish',
groups: mockGroups,
pipelineId: 159,
};
@@ -62,7 +62,7 @@ describe('stage column component', () => {
});
it('should render provided title', () => {
- expect(findStageColumnTitle().text()).toBe(defaultProps.title);
+ expect(findStageColumnTitle().text()).toBe(defaultProps.name);
});
it('should render the provided groups', () => {
@@ -104,16 +104,22 @@ describe('stage column component', () => {
props: {
groups: [
{
- id: 4259,
+ ...mockJob,
name: '<img src=x onerror=alert(document.domain)>',
- status: {
- icon: 'status_success',
- label: 'success',
- tooltip: '<img src=x onerror=alert(document.domain)>',
- },
+ jobs: [
+ {
+ id: 4259,
+ name: '<img src=x onerror=alert(document.domain)>',
+ status: {
+ icon: 'status_success',
+ label: 'success',
+ tooltip: '<img src=x onerror=alert(document.domain)>',
+ },
+ },
+ ],
},
],
- title: 'test <img src=x onerror=alert(document.domain)>',
+ name: 'test <img src=x onerror=alert(document.domain)>',
},
});
});
@@ -159,6 +165,7 @@ describe('stage column component', () => {
label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>',
},
+ jobs: [mockJob],
},
],
title: 'test',
@@ -191,6 +198,7 @@ describe('stage column component', () => {
label: 'success',
tooltip: '<img src=x onerror=alert(document.domain)>',
},
+ jobs: [mockJob],
},
],
title: 'test',