summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-02-02 16:45:21 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-02-02 16:45:21 +0000
commitebb951bac32dbc487b3a2ecdd7e9325c399f275d (patch)
tree6c3c1d9a37ac312a04b3a2a6c4ef60842bca95b4 /spec/javascripts
parent0ff966c162acb45c4f66a4fab812f884552ee350 (diff)
parent2916ea82d9e3bdb69e6eeb9544f494d7269214bd (diff)
downloadgitlab-ce-ebb951bac32dbc487b3a2ecdd7e9325c399f275d.tar.gz
Merge branch '25811-pipeline-number-and-url-do-not-update-when-new-pipeline-is-triggered' into 'master'
Update pipeline and commit URL and text on CI status change Closes #25811 See merge request !8351
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/merge_request_widget_spec.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/javascripts/merge_request_widget_spec.js b/spec/javascripts/merge_request_widget_spec.js
index bf45100af03..6f1d6406897 100644
--- a/spec/javascripts/merge_request_widget_spec.js
+++ b/spec/javascripts/merge_request_widget_spec.js
@@ -1,6 +1,7 @@
/* eslint-disable space-before-function-paren, quotes, comma-dangle, dot-notation, quote-props, no-var, max-len */
/*= require merge_request_widget */
+/*= require smart_interval */
/*= require lib/utils/datetime_utility */
(function() {
@@ -21,7 +22,11 @@
normal: "Build {{status}}"
},
gitlab_icon: "gitlab_logo.png",
- builds_path: "http://sampledomain.local/sampleBuildsPath"
+ ci_pipeline: 80,
+ ci_sha: "12a34bc5",
+ builds_path: "http://sampledomain.local/sampleBuildsPath",
+ commits_path: "http://sampledomain.local/commits",
+ pipeline_path: "http://sampledomain.local/pipelines"
};
this["class"] = new window.gl.MergeRequestWidget(this.opts);
});
@@ -118,10 +123,11 @@
});
});
- return describe('getCIStatus', function() {
+ describe('getCIStatus', function() {
beforeEach(function() {
this.ciStatusData = {
"title": "Sample MR title",
+ "pipeline": 80,
"sha": "12a34bc5",
"status": "success",
"coverage": 98
@@ -165,6 +171,22 @@
this["class"].getCIStatus(true);
return expect(spy).not.toHaveBeenCalled();
});
+ it('should update the pipeline URL when the pipeline changes', function() {
+ var spy;
+ spy = spyOn(this["class"], 'updatePipelineUrls').and.stub();
+ this["class"].getCIStatus(false);
+ this.ciStatusData.pipeline += 1;
+ this["class"].getCIStatus(false);
+ return expect(spy).toHaveBeenCalled();
+ });
+ it('should update the commit URL when the sha changes', function() {
+ var spy;
+ spy = spyOn(this["class"], 'updateCommitUrls').and.stub();
+ this["class"].getCIStatus(false);
+ this.ciStatusData.sha = "9b50b99a";
+ this["class"].getCIStatus(false);
+ return expect(spy).toHaveBeenCalled();
+ });
});
});
}).call(this);