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-10-19 15:57:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-19 15:57:54 +0300
commit419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch)
tree1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js
parent1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff)
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js')
-rw-r--r--spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js b/spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js
index ef2e5d779d8..62eae19ce4c 100644
--- a/spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js
+++ b/spec/frontend/pages/projects/find_file/ref_switcher/ref_switcher_utils_spec.js
@@ -10,7 +10,7 @@ describe('generateRefDestinationPath', () => {
${`${projectRootPath}/-/find_file/flightjs/Flight`} | ${`http://test.host/${projectRootPath}/-/find_file/${selectedRef}`}
${`${projectRootPath}/-/find_file/test/test1?test=something`} | ${`http://test.host/${projectRootPath}/-/find_file/${selectedRef}?test=something`}
${`${projectRootPath}/-/find_file/simpletest?test=something&test=it`} | ${`http://test.host/${projectRootPath}/-/find_file/${selectedRef}?test=something&test=it`}
- ${`${projectRootPath}/-/find_file/some_random_char?test=something&test[]=it&test[]=is`} | ${`http://test.host/${projectRootPath}/-/find_file/${selectedRef}?test=something&test[]=it&test[]=is`}
+ ${`${projectRootPath}/-/find_file/some_random_char?test=something&test[]=it&test[]=is`} | ${`http://test.host/${projectRootPath}/-/find_file/${selectedRef}?test=something&test%5B%5D=it&test%5B%5D=is`}
`('generates the correct destination path for $currentPath', ({ currentPath, result }) => {
setWindowLocation(currentPath);
expect(generateRefDestinationPath(selectedRef, '/-/find_file')).toBe(result);
@@ -36,4 +36,11 @@ describe('generateRefDestinationPath', () => {
`http://test.host/${projectRootPath}/-/find_file/flightjs/Flight`,
);
});
+
+ it('removes ref_type from the destination url if ref is neither a branch or tag', () => {
+ setWindowLocation(`${projectRootPath}/-/find_file/somebranch?ref_type=heads`);
+ expect(generateRefDestinationPath('8e90e533', '/-/find_file')).toBe(
+ `http://test.host/${projectRootPath}/-/find_file/8e90e533`,
+ );
+ });
});