summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-02-07 17:53:42 +0000
committerClement Ho <clemmakesapps@gmail.com>2017-02-07 17:53:42 +0000
commitbc13687c7e374116e4830d004b82e9960d3a55cc (patch)
tree36a787c2c38442237d5b3616d4e14189d1bd4379 /spec/javascripts
parent840072ec0491535a180a8d270327d37152b60295 (diff)
parentbcf81d82faf6db44a68d2c1148a693b59806057e (diff)
downloadgitlab-ce-bc13687c7e374116e4830d004b82e9960d3a55cc.tar.gz
Merge branch 'fix-anchor-scrolling' into 'master'
Fix broken anchor links when special characters are used Closes #26778 See merge request !8961
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/lib/utils/common_utils_spec.js.es613
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js.es6 b/spec/javascripts/lib/utils/common_utils_spec.js.es6
index fbb06f3948b..ff70664546d 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js.es6
+++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6
@@ -41,6 +41,19 @@ require('~/lib/utils/common_utils');
});
});
+ describe('gl.utils.handleLocationHash', () => {
+ beforeEach(() => {
+ window.history.pushState({}, null, '#definição');
+ });
+
+ it('decodes hash parameter', () => {
+ spyOn(window.document, 'getElementById').and.callThrough();
+ gl.utils.handleLocationHash();
+ expect(window.document.getElementById).toHaveBeenCalledWith('definição');
+ expect(window.document.getElementById).toHaveBeenCalledWith('user-content-definição');
+ });
+ });
+
describe('gl.utils.getParameterByName', () => {
beforeEach(() => {
window.history.pushState({}, null, '?scope=all&p=2');