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-07-24 21:08:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-24 21:08:45 +0300
commit2ae564d6f59fc939bfdbb155d445efe97b34c1e1 (patch)
tree106ebc2021d84757ca03610747a60c8f47ac9fb0 /spec/frontend/lib
parent7308ec9d13fb69018200a40f287e76ef499ed47c (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.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js
index 0f32eaa4ca6..e54ad674a36 100644
--- a/spec/frontend/lib/utils/url_utility_spec.js
+++ b/spec/frontend/lib/utils/url_utility_spec.js
@@ -1136,4 +1136,18 @@ describe('URL utility', () => {
expect(urlUtils.removeLastSlashInUrlPath(input)).toBe(output);
});
});
+
+ describe('buildURLwithRefType', () => {
+ const base = 'http://gitlab.com/';
+
+ it.each`
+ path | refType | output
+ ${'foo/bar'} | ${'heads'} | ${'/foo/bar?ref_type=heads'}
+ ${'/foo/bar/'} | ${'HEADS'} | ${'/foo/bar/?ref_type=heads'}
+ ${'/foo/bar/'} | ${''} | ${'/foo/bar/'}
+ ${'/'} | ${''} | ${'/'}
+ `('path $path with ref $refType becomes $output', ({ path, refType, output }) => {
+ expect(urlUtils.buildURLwithRefType({ base, path, refType })).toBe(output);
+ });
+ });
});