Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/url_utility_spec.js')
-rw-r--r--spec/frontend/lib/utils/url_utility_spec.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js
index ecd2d7f888d..e304ec70dc7 100644
--- a/spec/frontend/lib/utils/url_utility_spec.js
+++ b/spec/frontend/lib/utils/url_utility_spec.js
@@ -327,6 +327,26 @@ describe('URL utility', () => {
});
});
+ describe('getLocationHash', () => {
+ it('gets a default empty value', () => {
+ setWindowLocation(TEST_HOST);
+
+ expect(urlUtils.getLocationHash()).toBeUndefined();
+ });
+
+ it('gets a value', () => {
+ setWindowLocation('#hash-value');
+
+ expect(urlUtils.getLocationHash()).toBe('hash-value');
+ });
+
+ it('gets an empty value when only hash is set', () => {
+ setWindowLocation('#');
+
+ expect(urlUtils.getLocationHash()).toBeUndefined();
+ });
+ });
+
describe('doesHashExistInUrl', () => {
beforeEach(() => {
setWindowLocation('#note_1');