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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-27 18:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-27 18:09:37 +0300
commit57ae76cdb503afd6c0821de3a03b4387af6b59eb (patch)
treed6ffcbdd75157d969fcd5f4850f3a11f21b95a6c /spec/frontend/lib
parent5471fef2360f9bcf604a026d5807a554dae243e9 (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.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');