diff options
Diffstat (limited to 'spec/frontend/pipelines/pipeline_url_spec.js')
-rw-r--r-- | spec/frontend/pipelines/pipeline_url_spec.js | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/spec/frontend/pipelines/pipeline_url_spec.js b/spec/frontend/pipelines/pipeline_url_spec.js index b24e2e09ea8..2f083faaaa6 100644 --- a/spec/frontend/pipelines/pipeline_url_spec.js +++ b/spec/frontend/pipelines/pipeline_url_spec.js @@ -1,12 +1,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { trimText } from 'helpers/text_helper'; import PipelineUrlComponent from '~/pipelines/components/pipelines_list/pipeline_url.vue'; -import { - mockPipeline, - mockPipelineBranch, - mockPipelineTag, - mockPipelineNoCommit, -} from './mock_data'; +import { mockPipeline, mockPipelineBranch, mockPipelineTag } from './mock_data'; const projectPath = 'test/test'; @@ -31,7 +26,7 @@ describe('Pipeline Url Component', () => { const findCommitIconType = () => wrapper.findByTestId('commit-icon-type'); const findCommitTitleContainer = () => wrapper.findByTestId('commit-title-container'); - const findCommitTitle = () => wrapper.findByTestId('commit-title'); + const findCommitTitle = (commitWrapper) => commitWrapper.find('[data-testid="commit-title"]'); const defaultProps = mockPipeline(projectPath); @@ -237,33 +232,5 @@ describe('Pipeline Url Component', () => { expect(findCommitIconType().attributes('title')).toBe(expectedTitle); }, ); - - describe('with commit', () => { - beforeEach(() => { - createComponent({}, true); - }); - - it('displays commit title with link to pipeline', () => { - expect(findCommitTitle().attributes('href')).toBe(defaultProps.pipeline.path); - }); - - it('displays commit title text', () => { - expect(findCommitTitle().text()).toBe(defaultProps.pipeline.commit.title); - }); - }); - - describe('without commit', () => { - beforeEach(() => { - createComponent(mockPipelineNoCommit(), true); - }); - - it('displays cant find head commit text', () => { - expect(findCommitTitle().text()).toBe("Can't find HEAD commit for this branch"); - }); - - it('displays link to pipeline', () => { - expect(findCommitTitle().attributes('href')).toBe(mockPipelineNoCommit().pipeline.path); - }); - }); }); }); |