diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js')
-rw-r--r-- | spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js | 45 |
1 files changed, 24 insertions, 21 deletions
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 f6247fb4a19..46ef8a0d771 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 @@ -16,14 +16,15 @@ describe('CI Editor Header', () => { const createComponent = ({ showHelpDrawer = false, showJobAssistantDrawer = false, - showAiAssistantDrawer = false, aiChatAvailable = false, aiCiConfigGenerator = false, + ciCatalogPath = '/explore/catalog', } = {}) => { wrapper = extendedWrapper( shallowMount(CiEditorHeader, { provide: { aiChatAvailable, + ciCatalogPath, glFeatures: { aiCiConfigGenerator, }, @@ -31,7 +32,6 @@ describe('CI Editor Header', () => { propsData: { showHelpDrawer, showJobAssistantDrawer, - showAiAssistantDrawer, }, }), ); @@ -39,7 +39,7 @@ describe('CI Editor Header', () => { const findLinkBtn = () => wrapper.findByTestId('template-repo-link'); const findHelpBtn = () => wrapper.findByTestId('drawer-toggle'); - const findAiAssistnantBtn = () => wrapper.findByTestId('ai-assistant-drawer-toggle'); + const findCatalogRepoLinkButton = () => wrapper.findByTestId('catalog-repo-link'); afterEach(() => { unmockTracking(); @@ -55,29 +55,32 @@ describe('CI Editor Header', () => { label, }); }; - describe('Ai Assistant toggle button', () => { - describe('when feature is unavailable', () => { - it('should not show ai button when feature toggle is off', () => { - createComponent({ aiChatAvailable: true }); - mockTracking(undefined, wrapper.element, jest.spyOn); - expect(findAiAssistnantBtn().exists()).toBe(false); - }); - it('should not show ai button when feature is unavailable', () => { - createComponent({ aiCiConfigGenerator: true }); - mockTracking(undefined, wrapper.element, jest.spyOn); - expect(findAiAssistnantBtn().exists()).toBe(false); - }); + describe('component repo link button', () => { + beforeEach(() => { + createComponent(); + trackingSpy = mockTracking(undefined, wrapper.element, jest.spyOn); }); - describe('when feature is available', () => { - it('should show ai button', () => { - createComponent({ aiCiConfigGenerator: true, aiChatAvailable: true }); - mockTracking(undefined, wrapper.element, jest.spyOn); - expect(findAiAssistnantBtn().exists()).toBe(true); - }); + afterEach(() => { + unmockTracking(); + }); + + it('finds the CI/CD Catalog button', () => { + expect(findCatalogRepoLinkButton().exists()).toBe(true); + }); + + it('has the external-link icon', () => { + expect(findCatalogRepoLinkButton().props('icon')).toBe('external-link'); + }); + + it('tracks the click on the Catalog button', () => { + const { browseCatalog } = pipelineEditorTrackingOptions.actions; + + testTracker(findCatalogRepoLinkButton(), browseCatalog); }); }); + describe('link button', () => { beforeEach(() => { createComponent(); |