diff options
Diffstat (limited to 'spec/frontend/pipelines/components')
5 files changed, 17 insertions, 54 deletions
diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js index 7fa8a18ea1f..036b82530d5 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_mini_graph_spec.js @@ -48,7 +48,6 @@ describe('Pipeline Mini Graph', () => { isMergeTrain: false, pipelinePath: '', stages: expect.any(Array), - stagesClass: '', updateDropdown: false, upstreamPipeline: undefined, }); @@ -63,15 +62,6 @@ describe('Pipeline Mini Graph', () => { expect(findUpstreamArrowIcon().exists()).toBe(false); expect(findDownstreamArrowIcon().exists()).toBe(false); }); - - it('triggers events in "action request complete"', () => { - createComponent(); - - findPipelineMiniGraph(0).vm.$emit('pipelineActionRequestComplete'); - findPipelineMiniGraph(1).vm.$emit('pipelineActionRequestComplete'); - - expect(wrapper.emitted('pipelineActionRequestComplete')).toHaveLength(2); - }); }); describe('rendered state with upstream pipeline', () => { @@ -92,7 +82,6 @@ describe('Pipeline Mini Graph', () => { isMergeTrain: false, pipelinePath: '', stages: expect.any(Array), - stagesClass: '', updateDropdown: false, upstreamPipeline: expect.any(Object), }); @@ -124,7 +113,6 @@ describe('Pipeline Mini Graph', () => { isMergeTrain: false, pipelinePath: 'my/pipeline/path', stages: expect.any(Array), - stagesClass: '', updateDropdown: false, upstreamPipeline: undefined, }); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js index 52b440f18bb..b7a9297d856 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stage_spec.js @@ -186,7 +186,7 @@ describe('Pipelines stage component', () => { }); }); - describe('pipelineActionRequestComplete', () => { + describe('job update in dropdown', () => { beforeEach(async () => { mock.onGet(dropdownPath).reply(200, stageReply); mock.onPost(`${stageReply.latest_statuses[0].status.action.path}.json`).reply(200); @@ -204,24 +204,11 @@ describe('Pipelines stage component', () => { await findCiActionBtn().trigger('click'); }; - it('closes dropdown when job item action is clicked', async () => { - const hidden = jest.fn(); - - wrapper.vm.$root.$on('bv::dropdown::hide', hidden); - - expect(hidden).toHaveBeenCalledTimes(0); - - await clickCiAction(); - await waitForPromises(); - - expect(hidden).toHaveBeenCalledTimes(1); - }); - - it('emits `pipelineActionRequestComplete` when job item action is clicked', async () => { + it('keeps dropdown open when job item action is clicked', async () => { await clickCiAction(); await waitForPromises(); - expect(wrapper.emitted('pipelineActionRequestComplete')).toHaveLength(1); + expect(findDropdown().classes('show')).toBe(true); }); }); diff --git a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js index bfb780d5d39..c123f53886e 100644 --- a/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js +++ b/spec/frontend/pipelines/components/pipeline_mini_graph/pipeline_stages_spec.js @@ -26,12 +26,6 @@ describe('Pipeline Stages', () => { 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: [] }); @@ -39,15 +33,6 @@ describe('Pipeline Stages', () => { 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(); diff --git a/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js b/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js index ee3eaaf5ef3..ba7262353f0 100644 --- a/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js +++ b/spec/frontend/pipelines/components/pipelines_filtered_search_spec.js @@ -6,7 +6,10 @@ import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; import Api from '~/api'; import axios from '~/lib/utils/axios_utils'; import PipelinesFilteredSearch from '~/pipelines/components/pipelines_list/pipelines_filtered_search.vue'; -import { OPERATOR_IS_ONLY } from '~/vue_shared/components/filtered_search_bar/constants'; +import { + FILTERED_SEARCH_TERM, + OPERATORS_IS, +} from '~/vue_shared/components/filtered_search_bar/constants'; import { TRACKING_CATEGORIES } from '~/pipelines/constants'; import { users, mockSearch, branches, tags } from '../mock_data'; @@ -63,7 +66,7 @@ describe('Pipelines filtered search', () => { title: 'Trigger author', unique: true, projectId: '21', - operators: OPERATOR_IS_ONLY, + operators: OPERATORS_IS, }); expect(findBranchToken()).toMatchObject({ @@ -73,7 +76,7 @@ describe('Pipelines filtered search', () => { unique: true, projectId: '21', defaultBranchName: 'main', - operators: OPERATOR_IS_ONLY, + operators: OPERATORS_IS, }); expect(findSourceToken()).toMatchObject({ @@ -81,7 +84,7 @@ describe('Pipelines filtered search', () => { icon: 'trigger-source', title: 'Source', unique: true, - operators: OPERATOR_IS_ONLY, + operators: OPERATORS_IS, }); expect(findStatusToken()).toMatchObject({ @@ -89,7 +92,7 @@ describe('Pipelines filtered search', () => { icon: 'status', title: 'Status', unique: true, - operators: OPERATOR_IS_ONLY, + operators: OPERATORS_IS, }); expect(findTagToken()).toMatchObject({ @@ -97,7 +100,7 @@ describe('Pipelines filtered search', () => { icon: 'tag', title: 'Tag name', unique: true, - operators: OPERATOR_IS_ONLY, + operators: OPERATORS_IS, }); }); @@ -111,7 +114,7 @@ describe('Pipelines filtered search', () => { it('disables tag name token when branch name token is active', async () => { findFilteredSearch().vm.$emit('input', [ { type: 'ref', value: { data: 'branch-1', operator: '=' } }, - { type: 'filtered-search-term', value: { data: '' } }, + { type: FILTERED_SEARCH_TERM, value: { data: '' } }, ]); await nextTick(); @@ -122,7 +125,7 @@ describe('Pipelines filtered search', () => { it('disables branch name token when tag name token is active', async () => { findFilteredSearch().vm.$emit('input', [ { type: 'tag', value: { data: 'tag-1', operator: '=' } }, - { type: 'filtered-search-term', value: { data: '' } }, + { type: FILTERED_SEARCH_TERM, value: { data: '' } }, ]); await nextTick(); @@ -139,7 +142,7 @@ describe('Pipelines filtered search', () => { }); it('resets tokens disabled state when clearing tokens by backspace', async () => { - findFilteredSearch().vm.$emit('input', [{ type: 'filtered-search-term', value: { data: '' } }]); + findFilteredSearch().vm.$emit('input', [{ type: FILTERED_SEARCH_TERM, value: { data: '' } }]); await nextTick(); expect(findBranchToken().disabled).toBe(false); @@ -172,7 +175,7 @@ describe('Pipelines filtered search', () => { operator: '=', }, }, - { type: 'filtered-search-term', value: { data: '' } }, + { type: FILTERED_SEARCH_TERM, value: { data: '' } }, ]; expect(findFilteredSearch().props('value')).toMatchObject(expectedValueProp); diff --git a/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js b/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js index b537c81da3f..f255e0d857f 100644 --- a/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js +++ b/spec/frontend/pipelines/components/pipelines_list/empty_state/pipelines_ci_templates_spec.js @@ -13,7 +13,7 @@ import { RUNNERS_DOCUMENTATION_LINK_CLICKED_EVENT, RUNNERS_SETTINGS_BUTTON_CLICKED_EVENT, I18N, -} from '~/pipeline_editor/constants'; +} from '~/ci/pipeline_editor/constants'; const pipelineEditorPath = '/-/ci/editor'; const ciRunnerSettingsPath = '/-/settings/ci_cd'; |