diff options
Diffstat (limited to 'spec/frontend/ci_lint/graphql')
-rw-r--r-- | spec/frontend/ci_lint/graphql/__snapshots__/resolvers_spec.js.snap | 73 | ||||
-rw-r--r-- | spec/frontend/ci_lint/graphql/resolvers_spec.js | 38 |
2 files changed, 0 insertions, 111 deletions
diff --git a/spec/frontend/ci_lint/graphql/__snapshots__/resolvers_spec.js.snap b/spec/frontend/ci_lint/graphql/__snapshots__/resolvers_spec.js.snap deleted file mode 100644 index 87bec82e350..00000000000 --- a/spec/frontend/ci_lint/graphql/__snapshots__/resolvers_spec.js.snap +++ /dev/null @@ -1,73 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`~/ci_lint/graphql/resolvers Mutation lintCI resolves lint data with type names 1`] = ` -Object { - "__typename": "CiLintContent", - "errors": Array [], - "jobs": Array [ - Object { - "__typename": "CiLintJob", - "afterScript": Array [ - "echo 'after script 1", - ], - "allowFailure": false, - "beforeScript": Array [ - "echo 'before script 1'", - ], - "environment": "prd", - "except": Object { - "refs": Array [ - "master@gitlab-org/gitlab", - "/^release/.*$/@gitlab-org/gitlab", - ], - }, - "name": "job_1", - "only": null, - "script": Array [ - "echo 'script 1'", - ], - "stage": "test", - "tagList": Array [ - "tag 1", - ], - "when": "on_success", - }, - Object { - "__typename": "CiLintJob", - "afterScript": Array [ - "echo 'after script 2", - ], - "allowFailure": true, - "beforeScript": Array [ - "echo 'before script 2'", - ], - "environment": "stg", - "except": Object { - "refs": Array [ - "master@gitlab-org/gitlab", - "/^release/.*$/@gitlab-org/gitlab", - ], - }, - "name": "job_2", - "only": Object { - "__typename": "CiLintJobOnlyPolicy", - "refs": Array [ - "web", - "chat", - "pushes", - ], - }, - "script": Array [ - "echo 'script 2'", - ], - "stage": "test", - "tagList": Array [ - "tag 2", - ], - "when": "on_success", - }, - ], - "valid": true, - "warnings": Array [], -} -`; diff --git a/spec/frontend/ci_lint/graphql/resolvers_spec.js b/spec/frontend/ci_lint/graphql/resolvers_spec.js deleted file mode 100644 index 437c52cf6b4..00000000000 --- a/spec/frontend/ci_lint/graphql/resolvers_spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import MockAdapter from 'axios-mock-adapter'; -import axios from '~/lib/utils/axios_utils'; -import httpStatus from '~/lib/utils/http_status'; - -import resolvers from '~/ci_lint/graphql/resolvers'; -import { mockLintResponse } from '../mock_data'; - -describe('~/ci_lint/graphql/resolvers', () => { - let mock; - - beforeEach(() => { - mock = new MockAdapter(axios); - }); - - afterEach(() => { - mock.restore(); - }); - - describe('Mutation', () => { - describe('lintCI', () => { - const endpoint = '/ci/lint'; - - beforeEach(() => { - mock.onPost(endpoint).reply(httpStatus.OK, mockLintResponse); - }); - - it('resolves lint data with type names', async () => { - const result = resolvers.Mutation.lintCI(null, { - endpoint, - content: 'content', - dry_run: true, - }); - - await expect(result).resolves.toMatchSnapshot(); - }); - }); - }); -}); |