diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/frontend/pipelines | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/frontend/pipelines')
8 files changed, 24 insertions, 64 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'; diff --git a/spec/frontend/pipelines/pipeline_graph/pipeline_graph_spec.js b/spec/frontend/pipelines/pipeline_graph/pipeline_graph_spec.js index d9199f3b0f7..df10742fd93 100644 --- a/spec/frontend/pipelines/pipeline_graph/pipeline_graph_spec.js +++ b/spec/frontend/pipelines/pipeline_graph/pipeline_graph_spec.js @@ -1,7 +1,7 @@ import { GlAlert } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { setHTMLFixture } from 'helpers/fixtures'; -import { CI_CONFIG_STATUS_VALID } from '~/pipeline_editor/constants'; +import { CI_CONFIG_STATUS_VALID } from '~/ci/pipeline_editor/constants'; import LinksInner from '~/pipelines/components/graph_shared/links_inner.vue'; import LinksLayer from '~/pipelines/components/graph_shared/links_layer.vue'; import JobPill from '~/pipelines/components/pipeline_graph/job_pill.vue'; diff --git a/spec/frontend/pipelines/pipelines_table_spec.js b/spec/frontend/pipelines/pipelines_table_spec.js index 044683ce533..740037a5ac8 100644 --- a/spec/frontend/pipelines/pipelines_table_spec.js +++ b/spec/frontend/pipelines/pipelines_table_spec.js @@ -17,7 +17,6 @@ import { TRACKING_CATEGORIES, } from '~/pipelines/constants'; -import eventHub from '~/pipelines/event_hub'; import CiBadge from '~/vue_shared/components/ci_badge_link.vue'; jest.mock('~/pipelines/event_hub'); @@ -134,12 +133,6 @@ describe('Pipelines Table', () => { expect(findPipelineMiniGraph().props('stages')).toHaveLength(0); }); }); - - it('when action request is complete, should refresh table', () => { - findPipelineMiniGraph().vm.$emit('pipelineActionRequestComplete'); - - expect(eventHub.$emit).toHaveBeenCalledWith('refreshPipelinesTable'); - }); }); describe('duration cell', () => { diff --git a/spec/frontend/pipelines/tokens/pipeline_status_token_spec.js b/spec/frontend/pipelines/tokens/pipeline_status_token_spec.js index 94f9a37f707..c090fd353f7 100644 --- a/spec/frontend/pipelines/tokens/pipeline_status_token_spec.js +++ b/spec/frontend/pipelines/tokens/pipeline_status_token_spec.js @@ -2,6 +2,10 @@ import { GlFilteredSearchToken, GlFilteredSearchSuggestion, GlIcon } from '@gitl import { shallowMount } from '@vue/test-utils'; import { stubComponent } from 'helpers/stub_component'; import PipelineStatusToken from '~/pipelines/components/pipelines_list/tokens/pipeline_status_token.vue'; +import { + TOKEN_TITLE_STATUS, + TOKEN_TYPE_STATUS, +} from '~/vue_shared/components/filtered_search_bar/constants'; describe('Pipeline Status Token', () => { let wrapper; @@ -13,9 +17,9 @@ describe('Pipeline Status Token', () => { const defaultProps = { config: { - type: 'status', + type: TOKEN_TYPE_STATUS, icon: 'status', - title: 'Status', + title: TOKEN_TITLE_STATUS, unique: true, }, value: { |