fixed karma
This commit is contained in:
parent
02a2ca6ae4
commit
132db99a5b
2 changed files with 6 additions and 2 deletions
|
@ -85,9 +85,9 @@ export function redirectTo(url) {
|
|||
}
|
||||
|
||||
export function webIDEUrl(route = undefined) {
|
||||
let returnUrl = `${gon.relative_url_root}/-/ide/`;
|
||||
let returnUrl = `${gon.relative_url_root || ''}/-/ide/`;
|
||||
if (route) {
|
||||
returnUrl += `project${route.replace(new RegExp(`^${gon.relative_url_root}`), '')}`;
|
||||
returnUrl += `project${route.replace(new RegExp(`^${gon.relative_url_root || ''}`), '')}`;
|
||||
}
|
||||
return returnUrl;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,10 @@ import { webIDEUrl } from '~/lib/utils/url_utility';
|
|||
|
||||
describe('URL utility', () => {
|
||||
describe('webIDEUrl', () => {
|
||||
afterEach(() => {
|
||||
gon.relative_url_root = '';
|
||||
});
|
||||
|
||||
describe('without relative_url_root', () => {
|
||||
it('returns IDE path with route', () => {
|
||||
expect(webIDEUrl('/gitlab-org/gitlab-ce/merge_requests/1')).toBe(
|
||||
|
|
Loading…
Reference in a new issue