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:
Diffstat (limited to 'spec/frontend/work_items/utils_spec.js')
-rw-r--r--spec/frontend/work_items/utils_spec.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/frontend/work_items/utils_spec.js b/spec/frontend/work_items/utils_spec.js
index aa24b80cf08..8a49140119d 100644
--- a/spec/frontend/work_items/utils_spec.js
+++ b/spec/frontend/work_items/utils_spec.js
@@ -1,4 +1,4 @@
-import { autocompleteDataSources, markdownPreviewPath } from '~/work_items/utils';
+import { autocompleteDataSources, markdownPreviewPath, workItemPath } from '~/work_items/utils';
describe('autocompleteDataSources', () => {
beforeEach(() => {
@@ -25,3 +25,14 @@ describe('markdownPreviewPath', () => {
);
});
});
+
+describe('workItemPath', () => {
+ it('returns corrrect data sources', () => {
+ expect(workItemPath('project/group', '2')).toEqual('/project/group/-/work_items/2');
+ });
+
+ it('returns corrrect data sources with relative url root', () => {
+ gon.relative_url_root = '/foobar';
+ expect(workItemPath('project/group', '2')).toEqual('/foobar/project/group/-/work_items/2');
+ });
+});