summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-25 14:21:50 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-30 17:06:47 +0000
commit6789befbf6b0578718b0e461c60326cd97dc8640 (patch)
tree8e9dcbbb57f3cae2bfe78b6a58037eaba165e690
parentcb9cee545a5952ed35ccd95e8cd4abe228f09a7b (diff)
downloadgitlab-ce-6789befbf6b0578718b0e461c60326cd97dc8640.tar.gz
Fixes after review
Fix pipelines tests Fix rubocop
-rw-r--r--app/assets/javascripts/extensions/element.js.es614
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb22
2 files changed, 6 insertions, 30 deletions
diff --git a/app/assets/javascripts/extensions/element.js.es6 b/app/assets/javascripts/extensions/element.js.es6
index 0abe8644f30..328cc57dca0 100644
--- a/app/assets/javascripts/extensions/element.js.es6
+++ b/app/assets/javascripts/extensions/element.js.es6
@@ -1,19 +1,11 @@
/* global Element */
-/* eslint-disable consistent-return, max-len */
+/* eslint-disable consistent-return, max-len, no-empty, no-plusplus, func-names */
Element.prototype.closest = Element.prototype.closest || function closest(selector, selectedElement = this) {
if (!selectedElement) return;
return selectedElement.matches(selector) ? selectedElement : Element.prototype.closest(selector, selectedElement.parentElement);
};
-/* eslint-disable */
-/**
- * .matches polyfill from mdn
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
- *
- * .matches is used in our code.
- * In order to run the tests in Phantomjs we need this polyfill
- */
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.matchesSelector ||
@@ -22,8 +14,8 @@ if (!Element.prototype.matches) {
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector ||
function (s) {
- var matches = (this.document || this.ownerDocument).querySelectorAll(s),
- i = matches.length;
+ const matches = (this.document || this.ownerDocument).querySelectorAll(s);
+ let i = matches.length;
while (--i >= 0 && matches.item(i) !== this) {}
return i > -1;
};
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 201caf3bbd3..3350a3aeefc 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -25,16 +25,13 @@ describe "Pipelines", feature: true, js: true do
before { visit namespace_project_pipeline_path(project.namespace, project, pipeline) }
- it 'shows a list of builds' do
+ it 'shows the pipeline graph' do
+ expect(page).to have_selector('.pipeline-visualization')
+ expect(page).to have_content('Build')
expect(page).to have_content('Test')
- expect(page).to have_content(@success.id)
expect(page).to have_content('Deploy')
- expect(page).to have_content(@failed.id)
- expect(page).to have_content(@running.id)
- expect(page).to have_content(@external.id)
expect(page).to have_content('Retry failed')
expect(page).to have_content('Cancel running')
- expect(page).to have_link('Play')
end
it 'shows Pipeline tab pane as active' do
@@ -63,7 +60,6 @@ describe "Pipelines", feature: true, js: true do
before { click_on 'Retry failed' }
it { expect(page).not_to have_content('Retry failed') }
- it { expect(page).to have_selector('.retried') }
end
end
@@ -74,19 +70,8 @@ describe "Pipelines", feature: true, js: true do
before { click_on 'Cancel running' }
it { expect(page).not_to have_content('Cancel running') }
- it { expect(page).to have_selector('.ci-canceled') }
end
end
-
- context 'playing manual build' do
- before do
- within '.pipeline-holder' do
- click_link('Play')
- end
- end
-
- it { expect(@manual.reload).to be_pending }
- end
end
describe 'GET /:project/pipelines/:id/builds' do
@@ -166,5 +151,4 @@ describe "Pipelines", feature: true, js: true do
it { expect(@manual.reload).to be_pending }
end
end
-
end