summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2017-04-05 13:29:57 +0530
committerKushal Pandya <kushal@gitlab.com>2017-04-05 13:29:57 +0530
commit3ea4cdcbe50501457023dad097447866d45d39ec (patch)
treeeee84c9cb7be491b95cff7b1a7300f73b9bb1f33
parent498cd6b6c09fa46f0b0708a6806614ec0006802e (diff)
downloadgitlab-ce-12818-ci-status-as-favicon.tar.gz
Method rename to `setCiStatusFavicon`12818-ci-status-as-favicon
-rw-r--r--app/assets/javascripts/build.js2
-rw-r--r--app/assets/javascripts/merge_request_widget.js2
-rw-r--r--app/assets/javascripts/pipelines.js2
-rw-r--r--spec/javascripts/build_spec.js4
-rw-r--r--spec/javascripts/lib/utils/common_utils_spec.js4
-rw-r--r--spec/javascripts/merge_request_widget_spec.js14
6 files changed, 14 insertions, 14 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 9aaf340e9f1..fe54ecffdfe 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -88,7 +88,7 @@ window.Build = (function() {
dataType: 'json',
success: function(buildData) {
$('.js-build-output').html(buildData.trace_html);
- gl.utils.setCIStatusFavicon(`${this.pageUrl}/status.json`);
+ gl.utils.setCiStatusFavicon(`${this.pageUrl}/status.json`);
if (window.location.hash === DOWN_BUILD_TRACE) {
$("html,body").scrollTop(this.$buildTrace.height());
}
diff --git a/app/assets/javascripts/merge_request_widget.js b/app/assets/javascripts/merge_request_widget.js
index 88a48c84820..b0254b17dd2 100644
--- a/app/assets/javascripts/merge_request_widget.js
+++ b/app/assets/javascripts/merge_request_widget.js
@@ -161,7 +161,7 @@ import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
_this.status = data.status;
_this.hasCi = data.has_ci;
_this.updateMergeButton(_this.status, _this.hasCi);
- gl.utils.setCIStatusFavicon(_this.opts.pipeline_status_url);
+ gl.utils.setCiStatusFavicon(_this.opts.pipeline_status_url);
if (data.environments && data.environments.length) _this.renderEnvironments(data.environments);
if (data.status !== _this.opts.ci_status ||
data.sha !== _this.opts.ci_sha ||
diff --git a/app/assets/javascripts/pipelines.js b/app/assets/javascripts/pipelines.js
index 420201ea702..4252b615887 100644
--- a/app/assets/javascripts/pipelines.js
+++ b/app/assets/javascripts/pipelines.js
@@ -10,7 +10,7 @@ require('./lib/utils/bootstrap_linked_tabs');
}
if (options.pipelineStatusUrl) {
- gl.utils.setCIStatusFavicon(options.pipelineStatusUrl);
+ gl.utils.setCiStatusFavicon(options.pipelineStatusUrl);
}
this.addMarginToBuildColumns();
diff --git a/spec/javascripts/build_spec.js b/spec/javascripts/build_spec.js
index 5286328c9c0..beee6cb2969 100644
--- a/spec/javascripts/build_spec.js
+++ b/spec/javascripts/build_spec.js
@@ -75,7 +75,7 @@ describe('Build', () => {
expect(url).toBe(`${BUILD_URL}.json`);
expect(dataType).toBe('json');
expect(success).toEqual(jasmine.any(Function));
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
success.call(context, { trace_html: '<span>Example</span>', status: 'running' });
@@ -84,7 +84,7 @@ describe('Build', () => {
it('removes the spinner', () => {
const [{ success, context }] = $.ajax.calls.argsFor(0);
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
success.call(context, { trace_html: '<span>Example</span>', status: 'success' });
expect($('.js-build-refresh').length).toBe(0);
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js
index 08d370b6162..073173a93c2 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js
+++ b/spec/javascripts/lib/utils/common_utils_spec.js
@@ -293,7 +293,7 @@ require('~/lib/utils/common_utils');
});
});
- describe('gl.utils.setCIStatusFavicon', () => {
+ describe('gl.utils.setCiStatusFavicon', () => {
it('should set page favicon to CI status favicon based on provided status', () => {
const BUILD_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/builds/1/status.json`;
const FAVICON_PATH = 'ci_favicons/';
@@ -309,7 +309,7 @@ require('~/lib/utils/common_utils');
expect(spyResetFavicon).toHaveBeenCalled();
});
- gl.utils.setCIStatusFavicon(BUILD_URL);
+ gl.utils.setCiStatusFavicon(BUILD_URL);
});
});
});
diff --git a/spec/javascripts/merge_request_widget_spec.js b/spec/javascripts/merge_request_widget_spec.js
index a4ca498ccf1..88dae8c3e06 100644
--- a/spec/javascripts/merge_request_widget_spec.js
+++ b/spec/javascripts/merge_request_widget_spec.js
@@ -142,21 +142,21 @@ require('~/lib/utils/datetime_utility');
it('should call showCIStatus even if a notification should not be displayed', function() {
var spy;
spy = spyOn(this["class"], 'showCIStatus').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(false);
return expect(spy).toHaveBeenCalledWith(this.ciStatusData.status);
});
it('should call showCIStatus when a notification should be displayed', function() {
var spy;
spy = spyOn(this["class"], 'showCIStatus').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(true);
return expect(spy).toHaveBeenCalledWith(this.ciStatusData.status);
});
it('should call showCICoverage when the coverage rate is set', function() {
var spy;
spy = spyOn(this["class"], 'showCICoverage').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(false);
return expect(spy).toHaveBeenCalledWith(this.ciStatusData.coverage);
});
@@ -164,14 +164,14 @@ require('~/lib/utils/datetime_utility');
var spy;
this.ciStatusData.coverage = null;
spy = spyOn(this["class"], 'showCICoverage').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(false);
return expect(spy).not.toHaveBeenCalled();
});
it('should not display a notification on the first check after the widget has been created', function() {
var spy;
spy = spyOn(window, 'notify');
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"] = new window.gl.MergeRequestWidget(this.opts);
this["class"].getCIStatus(true);
return expect(spy).not.toHaveBeenCalled();
@@ -179,7 +179,7 @@ require('~/lib/utils/datetime_utility');
it('should update the pipeline URL when the pipeline changes', function() {
var spy;
spy = spyOn(this["class"], 'updatePipelineUrls').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(false);
this.ciStatusData.pipeline += 1;
this["class"].getCIStatus(false);
@@ -188,7 +188,7 @@ require('~/lib/utils/datetime_utility');
it('should update the commit URL when the sha changes', function() {
var spy;
spy = spyOn(this["class"], 'updateCommitUrls').and.stub();
- spyOn(gl.utils, 'setCIStatusFavicon').and.callFake(() => {});
+ spyOn(gl.utils, 'setCiStatusFavicon').and.callFake(() => {});
this["class"].getCIStatus(false);
this.ciStatusData.sha = "9b50b99a";
this["class"].getCIStatus(false);