diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-14 21:08:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-14 21:08:38 +0300 |
commit | 14160fad80415337f8c08755af53ee994b4a7518 (patch) | |
tree | bfe1bf6bad8cda3e3bbf905c9d8ac742420dd8a3 /spec/frontend/ci | |
parent | 7a33080fff9a735cbe77968d67b13ffa92c0ffae (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci')
4 files changed, 22 insertions, 18 deletions
diff --git a/spec/frontend/ci/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js b/spec/frontend/ci/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js index b07d63dd5d9..2845f76209b 100644 --- a/spec/frontend/ci/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/drawer/pipeline_editor_drawer_spec.js @@ -1,6 +1,7 @@ import { shallowMount } from '@vue/test-utils'; import { GlDrawer } from '@gitlab/ui'; import PipelineEditorDrawer from '~/ci/pipeline_editor/components/drawer/pipeline_editor_drawer.vue'; +import { EDITOR_APP_DRAWER_NONE } from '~/ci/pipeline_editor/constants'; describe('Pipeline editor drawer', () => { let wrapper; @@ -14,10 +15,10 @@ describe('Pipeline editor drawer', () => { it('emits close event when closing the drawer', () => { createComponent(); - expect(wrapper.emitted('close-drawer')).toBeUndefined(); + expect(wrapper.emitted('switch-drawer')).toBeUndefined(); findDrawer().vm.$emit('close'); - expect(wrapper.emitted('close-drawer')).toHaveLength(1); + expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_NONE]]); }); }); diff --git a/spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js b/spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js index f1a5c4169fb..f6247fb4a19 100644 --- a/spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js @@ -5,6 +5,8 @@ import CiEditorHeader from '~/ci/pipeline_editor/components/editor/ci_editor_hea import { pipelineEditorTrackingOptions, TEMPLATE_REPOSITORY_URL, + EDITOR_APP_DRAWER_HELP, + EDITOR_APP_DRAWER_NONE, } from '~/ci/pipeline_editor/constants'; describe('CI Editor Header', () => { @@ -12,7 +14,7 @@ describe('CI Editor Header', () => { let trackingSpy = null; const createComponent = ({ - showDrawer = false, + showHelpDrawer = false, showJobAssistantDrawer = false, showAiAssistantDrawer = false, aiChatAvailable = false, @@ -27,7 +29,7 @@ describe('CI Editor Header', () => { }, }, propsData: { - showDrawer, + showHelpDrawer, showJobAssistantDrawer, showAiAssistantDrawer, }, @@ -116,15 +118,15 @@ describe('CI Editor Header', () => { describe('when pipeline editor drawer is closed', () => { beforeEach(() => { - createComponent({ showDrawer: false }); + createComponent({ showHelpDrawer: false }); }); - it('emits open drawer event when clicked', () => { - expect(wrapper.emitted('open-drawer')).toBeUndefined(); + it('emits switch drawer event when clicked', () => { + expect(wrapper.emitted('switch-drawer')).toBeUndefined(); findHelpBtn().vm.$emit('click'); - expect(wrapper.emitted('open-drawer')).toHaveLength(1); + expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_HELP]]); }); it('tracks open help drawer action', () => { @@ -136,15 +138,15 @@ describe('CI Editor Header', () => { describe('when pipeline editor drawer is open', () => { beforeEach(() => { - createComponent({ showDrawer: true }); + createComponent({ showHelpDrawer: true }); }); it('emits close drawer event when clicked', () => { - expect(wrapper.emitted('close-drawer')).toBeUndefined(); + expect(wrapper.emitted('switch-drawer')).toBeUndefined(); findHelpBtn().vm.$emit('click'); - expect(wrapper.emitted('close-drawer')).toHaveLength(1); + expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_NONE]]); }); }); }); diff --git a/spec/frontend/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer_spec.js b/spec/frontend/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer_spec.js index 0258a1a8c7f..cf2797c255f 100644 --- a/spec/frontend/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer_spec.js @@ -15,6 +15,7 @@ import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import eventHub, { SCROLL_EDITOR_TO_BOTTOM } from '~/ci/pipeline_editor/event_hub'; +import { EDITOR_APP_DRAWER_NONE } from '~/ci/pipeline_editor/constants'; import { mockRunnersTagsQueryResponse, mockLintResponse, mockCiYml } from '../../mock_data'; Vue.use(VueApollo); @@ -96,20 +97,20 @@ describe('Job assistant drawer', () => { expect(findRulesItem().exists()).toBe(true); }); - it('should emit close job assistant drawer event when closing the drawer', () => { - expect(wrapper.emitted('close-job-assistant-drawer')).toBeUndefined(); + it('should emit switch drawer event when closing the drawer', () => { + expect(wrapper.emitted('switch-drawer')).toBeUndefined(); findDrawer().vm.$emit('close'); - expect(wrapper.emitted('close-job-assistant-drawer')).toHaveLength(1); + expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_NONE]]); }); - it('should emit close job assistant drawer event when click cancel button', () => { - expect(wrapper.emitted('close-job-assistant-drawer')).toBeUndefined(); + it('should emit switch drawer event when click cancel button', () => { + expect(wrapper.emitted('switch-drawer')).toBeUndefined(); findCancelButton().trigger('click'); - expect(wrapper.emitted('close-job-assistant-drawer')).toHaveLength(1); + expect(wrapper.emitted('switch-drawer')).toEqual([[EDITOR_APP_DRAWER_NONE]]); }); it('should block submit if job name is empty', async () => { diff --git a/spec/frontend/ci/pipeline_editor/components/pipeline_editor_tabs_spec.js b/spec/frontend/ci/pipeline_editor/components/pipeline_editor_tabs_spec.js index 870f9663290..77252a5c0b6 100644 --- a/spec/frontend/ci/pipeline_editor/components/pipeline_editor_tabs_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/pipeline_editor_tabs_spec.js @@ -53,7 +53,7 @@ describe('Pipeline editor tabs component', () => { ciFileContent: mockCiYml, currentTab: CREATE_TAB, isNewCiConfigFile: true, - showDrawer: false, + showHelpDrawer: false, showJobAssistantDrawer: false, showAiAssistantDrawer: false, ...props, |