diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-27 18:09:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-27 18:09:37 +0300 |
commit | 57ae76cdb503afd6c0821de3a03b4387af6b59eb (patch) | |
tree | d6ffcbdd75157d969fcd5f4850f3a11f21b95a6c /spec/frontend/lib | |
parent | 5471fef2360f9bcf604a026d5807a554dae243e9 (diff) |
Add latest changes from gitlab-org/gitlab@master
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'); |