diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:07:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:07:57 +0000 |
commit | 7881eb30eaa8b01dbcfe87faa09927c75c7d6e45 (patch) | |
tree | 298bc8d2c62b2f2c29cb8ecbcf3de3eaaa6466d9 /spec/javascripts/pipelines/pipeline_url_spec.js | |
parent | 64b66e0cb6d1bfd27abf24e06653f00bddb60597 (diff) | |
download | gitlab-ce-7881eb30eaa8b01dbcfe87faa09927c75c7d6e45.tar.gz |
Add latest changes from gitlab-org/gitlab@12-6-stable-ee
Diffstat (limited to 'spec/javascripts/pipelines/pipeline_url_spec.js')
-rw-r--r-- | spec/javascripts/pipelines/pipeline_url_spec.js | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/spec/javascripts/pipelines/pipeline_url_spec.js b/spec/javascripts/pipelines/pipeline_url_spec.js deleted file mode 100644 index aa196af2f33..00000000000 --- a/spec/javascripts/pipelines/pipeline_url_spec.js +++ /dev/null @@ -1,118 +0,0 @@ -import Vue from 'vue'; -import pipelineUrlComp from '~/pipelines/components/pipeline_url.vue'; - -describe('Pipeline Url Component', () => { - let PipelineUrlComponent; - - beforeEach(() => { - PipelineUrlComponent = Vue.extend(pipelineUrlComp); - }); - - it('should render a table cell', () => { - const component = new PipelineUrlComponent({ - propsData: { - pipeline: { - id: 1, - path: 'foo', - flags: {}, - }, - autoDevopsHelpPath: 'foo', - }, - }).$mount(); - - expect(component.$el.getAttribute('class')).toContain('table-section'); - }); - - it('should render a link the provided path and id', () => { - const component = new PipelineUrlComponent({ - propsData: { - pipeline: { - id: 1, - path: 'foo', - flags: {}, - }, - autoDevopsHelpPath: 'foo', - }, - }).$mount(); - - expect(component.$el.querySelector('.js-pipeline-url-link').getAttribute('href')).toEqual( - 'foo', - ); - - expect(component.$el.querySelector('.js-pipeline-url-link span').textContent).toEqual('#1'); - }); - - it('should render latest, yaml invalid, merge request, and stuck flags when provided', () => { - const component = new PipelineUrlComponent({ - propsData: { - pipeline: { - id: 1, - path: 'foo', - flags: { - latest: true, - yaml_errors: true, - stuck: true, - merge_request_pipeline: true, - detached_merge_request_pipeline: true, - }, - }, - autoDevopsHelpPath: 'foo', - }, - }).$mount(); - - expect(component.$el.querySelector('.js-pipeline-url-latest').textContent).toContain('latest'); - - expect(component.$el.querySelector('.js-pipeline-url-yaml').textContent).toContain( - 'yaml invalid', - ); - - expect(component.$el.querySelector('.js-pipeline-url-stuck').textContent).toContain('stuck'); - - expect(component.$el.querySelector('.js-pipeline-url-detached').textContent).toContain( - 'detached', - ); - }); - - it('should render a badge for autodevops', () => { - const component = new PipelineUrlComponent({ - propsData: { - pipeline: { - id: 1, - path: 'foo', - flags: { - latest: true, - yaml_errors: true, - stuck: true, - auto_devops: true, - }, - }, - autoDevopsHelpPath: 'foo', - }, - }).$mount(); - - expect(component.$el.querySelector('.js-pipeline-url-autodevops').textContent.trim()).toEqual( - 'Auto DevOps', - ); - }); - - it('should render error badge when pipeline has a failure reason set', () => { - const component = new PipelineUrlComponent({ - propsData: { - pipeline: { - id: 1, - path: 'foo', - flags: { - failure_reason: true, - }, - failure_reason: 'some reason', - }, - autoDevopsHelpPath: 'foo', - }, - }).$mount(); - - expect(component.$el.querySelector('.js-pipeline-url-failure').textContent).toContain('error'); - expect( - component.$el.querySelector('.js-pipeline-url-failure').getAttribute('data-original-title'), - ).toContain('some reason'); - }); -}); |