diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-23 16:19:34 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-23 16:19:34 +0000 |
commit | 743050cede59d4ffbd45f2ed0dc4d7f20b75c6bd (patch) | |
tree | d4f3f934c9c05b4ef6a2dfa5f522909b1121b3e4 /spec/javascripts | |
parent | f94c391752941f2793f348a587760aa159e011c0 (diff) | |
parent | c2d943a7ea8de71d9f735b10d3f410eeb7f8bf69 (diff) | |
download | gitlab-ce-743050cede59d4ffbd45f2ed0dc4d7f20b75c6bd.tar.gz |
Merge branch '37860-pipelines-page' into 'master'
Make pipelines table in MR view usable
See merge request gitlab-org/gitlab-ce!14941
Diffstat (limited to 'spec/javascripts')
3 files changed, 20 insertions, 7 deletions
diff --git a/spec/javascripts/pipelines/pipelines_table_row_spec.js b/spec/javascripts/pipelines/pipelines_table_row_spec.js index d7456a48bc1..a9126d2f4e9 100644 --- a/spec/javascripts/pipelines/pipelines_table_row_spec.js +++ b/spec/javascripts/pipelines/pipelines_table_row_spec.js @@ -10,6 +10,7 @@ describe('Pipelines Table Row', () => { propsData: { pipeline, autoDevopsHelpPath: 'foo', + viewType: 'root', }, }).$mount(); }; diff --git a/spec/javascripts/pipelines/pipelines_table_spec.js b/spec/javascripts/pipelines/pipelines_table_spec.js index 4f5eb42eb35..ca2f9163313 100644 --- a/spec/javascripts/pipelines/pipelines_table_spec.js +++ b/spec/javascripts/pipelines/pipelines_table_spec.js @@ -23,6 +23,7 @@ describe('Pipelines Table', () => { propsData: { pipelines: [], autoDevopsHelpPath: 'foo', + viewType: 'root', }, }).$mount(); }); @@ -49,6 +50,7 @@ describe('Pipelines Table', () => { propsData: { pipelines: [], autoDevopsHelpPath: 'foo', + viewType: 'root', }, }).$mount(); expect(component.$el.querySelectorAll('.commit.gl-responsive-table-row').length).toEqual(0); @@ -61,6 +63,7 @@ describe('Pipelines Table', () => { propsData: { pipelines: [pipeline], autoDevopsHelpPath: 'foo', + viewType: 'root', }, }).$mount(); diff --git a/spec/javascripts/vue_shared/components/ci_badge_link_spec.js b/spec/javascripts/vue_shared/components/ci_badge_link_spec.js index daed4da3e15..ba303738f71 100644 --- a/spec/javascripts/vue_shared/components/ci_badge_link_spec.js +++ b/spec/javascripts/vue_shared/components/ci_badge_link_spec.js @@ -1,8 +1,10 @@ import Vue from 'vue'; import ciBadge from '~/vue_shared/components/ci_badge_link.vue'; +import mountComponent from '../../helpers/vue_mount_component_helper'; describe('CI Badge Link Component', () => { let CIBadge; + let vm; const statuses = { canceled: { @@ -70,15 +72,17 @@ describe('CI Badge Link Component', () => { }, }; - it('should render each status badge', () => { + beforeEach(() => { CIBadge = Vue.extend(ciBadge); - Object.keys(statuses).map((status) => { - const vm = new CIBadge({ - propsData: { - status: statuses[status], - }, - }).$mount(); + }); + + afterEach(() => { + vm.$destroy(); + }); + it('should render each status badge', () => { + Object.keys(statuses).map((status) => { + vm = mountComponent(CIBadge, { status: statuses[status] }); expect(vm.$el.getAttribute('href')).toEqual(statuses[status].details_path); expect(vm.$el.textContent.trim()).toEqual(statuses[status].text); expect(vm.$el.getAttribute('class')).toEqual(`ci-status ci-${statuses[status].group}`); @@ -86,4 +90,9 @@ describe('CI Badge Link Component', () => { return vm; }); }); + + it('should not render label', () => { + vm = mountComponent(CIBadge, { status: statuses.canceled, showText: false }); + expect(vm.$el.textContent.trim()).toEqual(''); + }); }); |