integration: Add test case for non URI encoded link

This commit is contained in:
Himanshu Mishra
2021-02-15 16:35:25 +01:00
parent 67b6221a2a
commit 2f3be0a68b
@@ -50,6 +50,21 @@ describe('gitlab core', () => {
describe('getGitLabFileFetchUrl', () => {
it.each([
// Project URLs
{
config: configWithNoToken,
url:
'https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yaml',
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile.yaml/raw?ref=branch',
},
{
config: configWithNoToken,
// Works with non URI encoded link
url:
'https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file with spaces.yaml',
result:
'https://gitlab.com/api/v4/projects/12345/repository/files/my%2Fpath%2Fto%2Ffile%20with%20spaces.yaml/raw?ref=branch',
},
{
config: configWithNoToken,
url: