summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-04-07 17:31:32 +0000
committerJacob Schatz <jschatz@gitlab.com>2017-04-07 17:31:32 +0000
commitfd16c892556a345d43a5ffc1c7bbc28b63b0a49c (patch)
tree29f1fd22a0cb216e532bc62389628e2e23e8ed3d
parent8631779b1a012bdb5bd9d8de18d6faff49a5821b (diff)
parentac35566403652fc5cea0c42b273169584e5c9ce2 (diff)
downloadgitlab-ce-fd16c892556a345d43a5ffc1c7bbc28b63b0a49c.tar.gz
Merge branch 'karma-failure-fix' into 'master'
Fixed duplicate jQuery AJAX spyon See merge request !10531
-rw-r--r--app/assets/javascripts/merge_request_tabs.js6
-rw-r--r--spec/javascripts/merge_request_tabs_spec.js7
2 files changed, 6 insertions, 7 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 8528e0800ae..7f6c74ce39a 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -102,10 +102,10 @@ import './flash';
destroyPipelinesView() {
if (this.commitPipelinesTable) {
- document.querySelector('#commit-pipeline-table-view')
- .removeChild(this.commitPipelinesTable.$el);
-
this.commitPipelinesTable.$destroy();
+ this.commitPipelinesTable = null;
+
+ document.querySelector('#commit-pipeline-table-view').innerHTML = '';
}
}
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js
index 5354e536edc..69eb7b1a4cb 100644
--- a/spec/javascripts/merge_request_tabs_spec.js
+++ b/spec/javascripts/merge_request_tabs_spec.js
@@ -222,7 +222,9 @@ require('vendor/jquery.scrollTo');
describe('#tabShown', () => {
beforeEach(function () {
- spyOn($, 'ajax').and.callFake(function () {});
+ spyOn($, 'ajax').and.callFake(function (options) {
+ options.success({ html: '' });
+ });
loadFixtures('merge_requests/merge_request_with_task_list.html.raw');
});
@@ -230,9 +232,6 @@ require('vendor/jquery.scrollTo');
beforeEach(function () {
this.class.diffViewType = () => 'parallel';
gl.Diff.prototype.diffViewType = () => 'parallel';
- spyOn($, 'ajax').and.callFake(function (options) {
- options.success({ html: '' });
- });
});
it('maintains `container-limited` for pipelines tab', function (done) {