diff options
Diffstat (limited to 'spec/frontend/lib')
-rw-r--r-- | spec/frontend/lib/utils/url_utility_spec.js | 20 |
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'); |