diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-24 21:08:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-24 21:08:45 +0300 |
commit | 2ae564d6f59fc939bfdbb155d445efe97b34c1e1 (patch) | |
tree | 106ebc2021d84757ca03610747a60c8f47ac9fb0 /spec/frontend/lib | |
parent | 7308ec9d13fb69018200a40f287e76ef499ed47c (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 | 14 |
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); + }); + }); }); |