summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2017-12-05 18:47:31 +0100
committerAlexis Reigel <mail@koffeinfrei.org>2018-06-05 16:20:21 +0200
commit5202c3f0c8da618e2d3821917f6f5d48ae8ae3c2 (patch)
treebef9ac2986fa42a0b43928e23447abb68d299fa4 /spec
parent67fe0a17d87a7a5380b41e04ef23212d5da637ba (diff)
downloadgitlab-ce-5202c3f0c8da618e2d3821917f6f5d48ae8ae3c2.tar.gz
fix resetFavicon so that it actually resets
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/lib/utils/common_utils_spec.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js
index 27f06573432..64d13275a59 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js
+++ b/spec/javascripts/lib/utils/common_utils_spec.js
@@ -395,6 +395,7 @@ describe('common_utils', () => {
const favicon = document.createElement('link');
favicon.setAttribute('id', 'favicon');
favicon.setAttribute('href', 'default/favicon');
+ favicon.setAttribute('data-default-href', 'default/favicon');
document.body.appendChild(favicon);
});
@@ -413,7 +414,7 @@ describe('common_utils', () => {
beforeEach(() => {
const favicon = document.createElement('link');
favicon.setAttribute('id', 'favicon');
- favicon.setAttribute('href', 'default/favicon');
+ favicon.setAttribute('data-original-href', 'default/favicon');
document.body.appendChild(favicon);
});
@@ -421,7 +422,9 @@ describe('common_utils', () => {
document.body.removeChild(document.getElementById('favicon'));
});
- it('should reset page favicon to tanuki', () => {
+ it('should reset page favicon to the default icon', () => {
+ const favicon = document.getElementById('favicon');
+ favicon.setAttribute('href', 'new/favicon');
commonUtils.resetFavicon();
expect(document.getElementById('favicon').getAttribute('href')).toEqual('default/favicon');
});
@@ -434,6 +437,8 @@ describe('common_utils', () => {
beforeEach(() => {
const favicon = document.createElement('link');
favicon.setAttribute('id', 'favicon');
+ favicon.setAttribute('href', 'null');
+ favicon.setAttribute('data-original-href', faviconDataUrl);
document.body.appendChild(favicon);
mock = new MockAdapter(axios);
});
@@ -449,7 +454,7 @@ describe('common_utils', () => {
commonUtils.setCiStatusFavicon(BUILD_URL)
.then(() => {
const favicon = document.getElementById('favicon');
- expect(favicon.getAttribute('href')).toEqual('null');
+ expect(favicon.getAttribute('href')).toEqual(faviconDataUrl);
done();
})
// Error is already caught in catch() block of setCiStatusFavicon,