diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js')
-rw-r--r-- | spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js b/spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js deleted file mode 100644 index 1cb43c199aa..00000000000 --- a/spec/frontend/pipelines/components/pipelines_list/pipeline_mini_graph_spec.js +++ /dev/null @@ -1,83 +0,0 @@ -import { shallowMount } from '@vue/test-utils'; -import { pipelines } from 'test_fixtures/pipelines/pipelines.json'; -import PipelineMiniGraph from '~/pipelines/components/pipelines_list/pipeline_mini_graph.vue'; -import PipelineStage from '~/pipelines/components/pipelines_list/pipeline_stage.vue'; - -const mockStages = pipelines[0].details.stages; - -describe('Pipeline Mini Graph', () => { - let wrapper; - - const findPipelineStages = () => wrapper.findAll(PipelineStage); - const findPipelineStagesAt = (i) => findPipelineStages().at(i); - - const createComponent = (props = {}) => { - wrapper = shallowMount(PipelineMiniGraph, { - propsData: { - stages: mockStages, - ...props, - }, - }); - }; - - it('renders stages', () => { - createComponent(); - - expect(findPipelineStages()).toHaveLength(mockStages.length); - }); - - it('renders stages with a custom class', () => { - createComponent({ stagesClass: 'my-class' }); - - expect(wrapper.findAll('.my-class')).toHaveLength(mockStages.length); - }); - - it('does not fail when stages are empty', () => { - createComponent({ stages: [] }); - - expect(wrapper.exists()).toBe(true); - expect(findPipelineStages()).toHaveLength(0); - }); - - it('triggers events in "action request complete" in stages', () => { - createComponent(); - - findPipelineStagesAt(0).vm.$emit('pipelineActionRequestComplete'); - findPipelineStagesAt(1).vm.$emit('pipelineActionRequestComplete'); - - expect(wrapper.emitted('pipelineActionRequestComplete')).toHaveLength(2); - }); - - it('update dropdown is false by default', () => { - createComponent(); - - expect(findPipelineStagesAt(0).props('updateDropdown')).toBe(false); - expect(findPipelineStagesAt(1).props('updateDropdown')).toBe(false); - }); - - it('update dropdown is set to true', () => { - createComponent({ updateDropdown: true }); - - expect(findPipelineStagesAt(0).props('updateDropdown')).toBe(true); - expect(findPipelineStagesAt(1).props('updateDropdown')).toBe(true); - }); - - it('is merge train is false by default', () => { - createComponent(); - - expect(findPipelineStagesAt(0).props('isMergeTrain')).toBe(false); - expect(findPipelineStagesAt(1).props('isMergeTrain')).toBe(false); - }); - - it('is merge train is set to true', () => { - createComponent({ isMergeTrain: true }); - - expect(findPipelineStagesAt(0).props('isMergeTrain')).toBe(true); - expect(findPipelineStagesAt(1).props('isMergeTrain')).toBe(true); - }); - - afterEach(() => { - wrapper.destroy(); - wrapper = null; - }); -}); |