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>2020-01-24 18:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-24 18:09:00 +0300
commitc282dba898a4cb0645f88579339502a4e3778727 (patch)
tree94a6457ce4438e085c9ae43bc51a2b5a29787bf2 /spec/frontend/graphql_shared
parent2c2dd5e36c4ed5f09f488be288882d98f9124d12 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/graphql_shared')
-rw-r--r--spec/frontend/graphql_shared/utils_spec.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/frontend/graphql_shared/utils_spec.js b/spec/frontend/graphql_shared/utils_spec.js
new file mode 100644
index 00000000000..52386bf6ede
--- /dev/null
+++ b/spec/frontend/graphql_shared/utils_spec.js
@@ -0,0 +1,42 @@
+import { getIdFromGraphQLId } from '~/graphql_shared/utils';
+
+describe('getIdFromGraphQLId', () => {
+ [
+ {
+ input: '',
+ output: null,
+ },
+ {
+ input: null,
+ output: null,
+ },
+ {
+ input: 'gid://',
+ output: null,
+ },
+ {
+ input: 'gid://gitlab/',
+ output: null,
+ },
+ {
+ input: 'gid://gitlab/Environments',
+ output: null,
+ },
+ {
+ input: 'gid://gitlab/Environments/',
+ output: null,
+ },
+ {
+ input: 'gid://gitlab/Environments/123',
+ output: 123,
+ },
+ {
+ input: 'gid://gitlab/DesignManagement::Version/2',
+ output: 2,
+ },
+ ].forEach(({ input, output }) => {
+ it(`getIdFromGraphQLId returns ${output} when passed ${input}`, () => {
+ expect(getIdFromGraphQLId(input)).toBe(output);
+ });
+ });
+});