diff options
Diffstat (limited to 'spec/frontend/pipeline_editor/components')
-rw-r--r-- | spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js | 8 | ||||
-rw-r--r-- | spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js b/spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js index b6d49d0d0f8..a95921359cc 100644 --- a/spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js +++ b/spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js @@ -44,6 +44,7 @@ describe('Pipeline Status', () => { const findPipelineCommit = () => wrapper.find('[data-testid="pipeline-commit"]'); const findPipelineErrorMsg = () => wrapper.find('[data-testid="pipeline-error-msg"]'); const findPipelineLoadingMsg = () => wrapper.find('[data-testid="pipeline-loading-msg"]'); + const findPipelineViewBtn = () => wrapper.find('[data-testid="pipeline-view-btn"]'); beforeEach(() => { mockPipelineQuery = jest.fn(); @@ -96,11 +97,15 @@ describe('Pipeline Status', () => { }); it('renders pipeline data', () => { - const { id } = mockProjectPipeline.pipeline; + const { + id, + detailedStatus: { detailsPath }, + } = mockProjectPipeline.pipeline; expect(findCiIcon().exists()).toBe(true); expect(findPipelineId().text()).toBe(`#${id.match(/\d+/g)[0]}`); expect(findPipelineCommit().text()).toBe(mockCommitSha); + expect(findPipelineViewBtn().attributes('href')).toBe(detailsPath); }); }); @@ -121,6 +126,7 @@ describe('Pipeline Status', () => { expect(findCiIcon().exists()).toBe(false); expect(findPipelineId().exists()).toBe(false); expect(findPipelineCommit().exists()).toBe(false); + expect(findPipelineViewBtn().exists()).toBe(false); }); }); }); diff --git a/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js b/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js index 93ebbc648fe..9f910ed4f9c 100644 --- a/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js +++ b/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js @@ -1,5 +1,6 @@ import { GlAlert } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import setWindowLocation from 'helpers/set_window_location_helper'; import { TEST_HOST } from 'helpers/test_constants'; import CodeSnippetAlert from '~/pipeline_editor/components/code_snippet_alert/code_snippet_alert.vue'; import { CODE_SNIPPET_SOURCES } from '~/pipeline_editor/components/code_snippet_alert/constants'; @@ -12,6 +13,10 @@ import { LOAD_FAILURE_UNKNOWN, } from '~/pipeline_editor/constants'; +beforeEach(() => { + setWindowLocation(TEST_HOST); +}); + describe('Pipeline Editor messages', () => { let wrapper; @@ -95,9 +100,7 @@ describe('Pipeline Editor messages', () => { describe('code snippet alert', () => { const setCodeSnippetUrlParam = (value) => { - global.jsdom.reconfigure({ - url: `${TEST_HOST}/?code_snippet_copied_from=${value}`, - }); + setWindowLocation(`${TEST_HOST}/?code_snippet_copied_from=${value}`); }; it('does not show by default', () => { |