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>2021-01-14 00:11:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-14 00:11:00 +0300
commitacba9e99b4f8bfeaaed143b72b07170a8506f893 (patch)
tree3f79c9c68e59c42c79dec7d4b353a3bbb3e118e0 /spec/frontend/helpers
parent716896e8cac8a516cd36efada8c8c5f383b63f62 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/helpers')
-rw-r--r--spec/frontend/helpers/help_page_helper_spec.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/frontend/helpers/help_page_helper_spec.js b/spec/frontend/helpers/help_page_helper_spec.js
new file mode 100644
index 00000000000..09c1a113a96
--- /dev/null
+++ b/spec/frontend/helpers/help_page_helper_spec.js
@@ -0,0 +1,29 @@
+import { helpPagePath } from '~/helpers/help_page_helper';
+
+describe('help page helper', () => {
+ it.each`
+ relative_url_root | path | anchor | expected
+ ${undefined} | ${'administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${''} | ${'administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${'/'} | ${'administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${'/gitlab'} | ${'administration/index'} | ${undefined} | ${'/gitlab/help/administration/index'}
+ ${'/gitlab/'} | ${'administration/index'} | ${undefined} | ${'/gitlab/help/administration/index'}
+ ${undefined} | ${'administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${'/'} | ${'administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${''} | ${'administration/index.md'} | ${undefined} | ${'/help/administration/index.md'}
+ ${''} | ${'administration/index.md'} | ${'installing-gitlab'} | ${'/help/administration/index.md#installing-gitlab'}
+ ${''} | ${'administration/index'} | ${'installing-gitlab'} | ${'/help/administration/index#installing-gitlab'}
+ ${''} | ${'administration/index'} | ${'#installing-gitlab'} | ${'/help/administration/index#installing-gitlab'}
+ ${''} | ${'/administration/index'} | ${undefined} | ${'/help/administration/index'}
+ ${''} | ${'administration/index/'} | ${undefined} | ${'/help/administration/index/'}
+ ${''} | ${'/administration/index/'} | ${undefined} | ${'/help/administration/index/'}
+ ${'/'} | ${'/administration/index'} | ${undefined} | ${'/help/administration/index'}
+ `(
+ 'generates correct URL when path is `$path`, relative url is `$relative_url_root` and anchor is `$anchor`',
+ ({ relative_url_root, anchor, path, expected }) => {
+ window.gon = { relative_url_root };
+
+ expect(helpPagePath(path, { anchor })).toBe(expected);
+ },
+ );
+});