diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-06-15 12:51:47 -0500 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-06-15 14:38:49 -0500 |
commit | 2c09250414759fb6aedf7ab1cd4d73dcfcc58625 (patch) | |
tree | 80cb39af5444d7ce24b61eb4a443994d42207163 | |
parent | 24a7d7bd94edf6be8a4723f6bd861e7e166258a1 (diff) | |
download | gitlab-ce-31415-responsive-pipelines-table-2.tar.gz |
Fix specs; only show pipeline actions if they exist31415-responsive-pipelines-table-2
3 files changed, 14 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_shared/components/pipelines_table_row.vue b/app/assets/javascripts/vue_shared/components/pipelines_table_row.vue index fdae9cac08e..4d5ebe2e9ed 100644 --- a/app/assets/javascripts/vue_shared/components/pipelines_table_row.vue +++ b/app/assets/javascripts/vue_shared/components/pipelines_table_row.vue @@ -200,6 +200,13 @@ export default { } return {}; }, + + displayPipelineActions() { + return this.pipeline.flags.retryable || + this.pipeline.flags.cancelable || + this.pipeline.details.manual_actions.length || + this.pipeline.details.artifacts.length; + }, }, }; </script> @@ -258,10 +265,11 @@ export default { /> <div - v-if="pipeline.details.manual_actions.length" + v-if="displayPipelineActions" class="table-section section-20 table-button-footer pipeline-actions"> <div class="btn-group table-action-buttons"> <pipelines-actions-component + v-if="pipeline.details.manual_actions.length" :actions="pipeline.details.manual_actions" :service="service" /> diff --git a/spec/features/merge_requests/pipelines_spec.rb b/spec/features/merge_requests/pipelines_spec.rb index 4c76004cb93..744bd484a80 100644 --- a/spec/features/merge_requests/pipelines_spec.rb +++ b/spec/features/merge_requests/pipelines_spec.rb @@ -28,7 +28,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do end wait_for_requests - expect(page).to have_selector('.pipeline-actions') + expect(page).to have_selector('.stage-cell') end end diff --git a/spec/javascripts/vue_shared/components/pipelines_table_spec.js b/spec/javascripts/vue_shared/components/pipelines_table_spec.js index a3376bfa40c..4c35d702004 100644 --- a/spec/javascripts/vue_shared/components/pipelines_table_spec.js +++ b/spec/javascripts/vue_shared/components/pipelines_table_spec.js @@ -36,10 +36,10 @@ describe('Pipelines Table', () => { }); it('should render table head with correct columns', () => { - expect(component.$el.querySelector('.table-section.js-pipeline-status').textContent).toEqual('Status'); - expect(component.$el.querySelector('.table-section.js-pipeline-info').textContent).toEqual('Pipeline'); - expect(component.$el.querySelector('.table-section.js-pipeline-commit').textContent).toEqual('Commit'); - expect(component.$el.querySelector('.table-section.js-pipeline-stages').textContent).toEqual('Stages'); + expect(component.$el.querySelector('.table-section.js-pipeline-status').textContent.trim()).toEqual('Status'); + expect(component.$el.querySelector('.table-section.js-pipeline-info').textContent.trim()).toEqual('Pipeline'); + expect(component.$el.querySelector('.table-section.js-pipeline-commit').textContent.trim()).toEqual('Commit'); + expect(component.$el.querySelector('.table-section.js-pipeline-stages').textContent.trim()).toEqual('Stages'); }); }); |