diff options
Diffstat (limited to 'spec/contracts/consumer/fixtures')
8 files changed, 132 insertions, 24 deletions
diff --git a/spec/contracts/consumer/fixtures/project/merge_request/diffs_batch.fixture.js b/spec/contracts/consumer/fixtures/project/merge_request/diffs_batch.fixture.js index b53e4bb335d..673aad721b3 100644 --- a/spec/contracts/consumer/fixtures/project/merge_request/diffs_batch.fixture.js +++ b/spec/contracts/consumer/fixtures/project/merge_request/diffs_batch.fixture.js @@ -1,5 +1,3 @@ -/* eslint-disable @gitlab/require-i18n-strings */ - import { Matchers } from '@pact-foundation/pact'; const body = { @@ -73,8 +71,12 @@ const DiffsBatch = { body, }, - request: { + scenario: { + state: 'a merge request with diffs exists', uponReceiving: 'a request for diff lines', + }, + + request: { withRequest: { method: 'GET', path: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_batch.json', @@ -87,5 +89,3 @@ const DiffsBatch = { }; export { DiffsBatch }; - -/* eslint-enable @gitlab/require-i18n-strings */ diff --git a/spec/contracts/consumer/fixtures/project/merge_request/diffs_metadata.fixture.js b/spec/contracts/consumer/fixtures/project/merge_request/diffs_metadata.fixture.js index 39dbcf78ee7..2fee4a02023 100644 --- a/spec/contracts/consumer/fixtures/project/merge_request/diffs_metadata.fixture.js +++ b/spec/contracts/consumer/fixtures/project/merge_request/diffs_metadata.fixture.js @@ -1,5 +1,3 @@ -/* eslint-disable @gitlab/require-i18n-strings */ - import { Matchers } from '@pact-foundation/pact'; const body = { @@ -81,8 +79,12 @@ const DiffsMetadata = { body, }, + scenario: { + state: 'a merge request exists', + uponReceiving: 'a request for diffs metadata', + }, + request: { - uponReceiving: 'a request for Diffs Metadata', withRequest: { method: 'GET', path: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_metadata.json', @@ -94,5 +96,3 @@ const DiffsMetadata = { }; export { DiffsMetadata }; - -/* eslint-enable @gitlab/require-i18n-strings */ diff --git a/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js b/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js index af0962a01cb..8c392395e1c 100644 --- a/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js +++ b/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js @@ -1,5 +1,3 @@ -/* eslint-disable @gitlab/require-i18n-strings */ - import { Matchers } from '@pact-foundation/pact'; const body = Matchers.eachLike({ @@ -70,8 +68,12 @@ const Discussions = { body, }, - request: { + scenario: { + state: 'a merge request with discussions exists', uponReceiving: 'a request for discussions', + }, + + request: { withRequest: { method: 'GET', path: '/gitlab-org/gitlab-qa/-/merge_requests/1/discussions.json', @@ -83,5 +85,3 @@ const Discussions = { }; export { Discussions }; - -/* eslint-enable @gitlab/require-i18n-strings */ diff --git a/spec/contracts/consumer/fixtures/project/pipeline/create_a_new_pipeline.fixture.js b/spec/contracts/consumer/fixtures/project/pipeline/create_a_new_pipeline.fixture.js new file mode 100644 index 00000000000..68063d2fb0c --- /dev/null +++ b/spec/contracts/consumer/fixtures/project/pipeline/create_a_new_pipeline.fixture.js @@ -0,0 +1,39 @@ +import { Matchers } from '@pact-foundation/pact'; +import { REDIRECT_HTML } from '../../../helpers/common_regex_patterns'; + +const body = Matchers.term({ + matcher: REDIRECT_HTML, + generate: + '<html><body>You are being <a href="http://example.org/gitlab-org/gitlab-qa/-/pipelines/5">redirected</a>.</body></html>', +}); + +const NewProjectPipeline = { + success: { + status: 302, + headers: { + 'Content-Type': 'text/html; charset=utf-8', + }, + body, + }, + + scenario: { + state: 'a project with a valid .gitlab-ci.yml configuration exists', + uponReceiving: 'a request to create a new pipeline', + }, + + request: { + withRequest: { + method: 'POST', + path: '/gitlab-org/gitlab-qa/-/pipelines', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json; charset=utf-8', + }, + body: { + ref: 'master', + }, + }, + }, +}; + +export { NewProjectPipeline }; diff --git a/spec/contracts/consumer/fixtures/project/pipeline/delete_pipeline.fixture.js b/spec/contracts/consumer/fixtures/project/pipeline/delete_pipeline.fixture.js new file mode 100644 index 00000000000..2e3e7355b99 --- /dev/null +++ b/spec/contracts/consumer/fixtures/project/pipeline/delete_pipeline.fixture.js @@ -0,0 +1,24 @@ +const DeletePipeline = { + success: { + status: 200, + headers: { + 'Content-Type': 'application/json; charset=utf-8', + }, + }, + + scenario: { + state: 'a pipeline for a project exists', + uponReceiving: 'a request to delete the pipeline', + }, + + request: { + method: 'POST', + path: '/api/graphql', + }, + + variables: { + id: 'gid://gitlab/Ci::Pipeline/316112', + }, +}; + +export { DeletePipeline }; diff --git a/spec/contracts/consumer/fixtures/project/pipeline/get_list_project_pipelines.fixture.js b/spec/contracts/consumer/fixtures/project/pipeline/get_list_project_pipelines.fixture.js index 8a7663325b9..a982e927572 100644 --- a/spec/contracts/consumer/fixtures/project/pipeline/get_list_project_pipelines.fixture.js +++ b/spec/contracts/consumer/fixtures/project/pipeline/get_list_project_pipelines.fixture.js @@ -1,5 +1,3 @@ -/* eslint-disable @gitlab/require-i18n-strings */ - import { Matchers } from '@pact-foundation/pact'; import { URL, @@ -225,8 +223,12 @@ const ProjectPipelines = { body, }, - request: { + scenario: { + state: 'a few pipelines for a project exists', uponReceiving: 'a request for a list of project pipelines', + }, + + request: { withRequest: { method: 'GET', path: '/gitlab-org/gitlab-qa/-/pipelines.json', @@ -239,5 +241,3 @@ const ProjectPipelines = { }; export { ProjectPipelines }; - -/* eslint-enable @gitlab/require-i18n-strings */ diff --git a/spec/contracts/consumer/fixtures/project/pipeline/get_pipeline_header_data.fixture.js b/spec/contracts/consumer/fixtures/project/pipeline/get_pipeline_header_data.fixture.js index f51ed9c2c74..b14a230d2e0 100644 --- a/spec/contracts/consumer/fixtures/project/pipeline/get_pipeline_header_data.fixture.js +++ b/spec/contracts/consumer/fixtures/project/pipeline/get_pipeline_header_data.fixture.js @@ -1,5 +1,3 @@ -/* eslint-disable @gitlab/require-i18n-strings */ - import { Matchers } from '@pact-foundation/pact'; import { JOB_STATUSES, @@ -83,6 +81,11 @@ const PipelineHeaderData = { body, }, + scenario: { + state: 'a pipeline for a project exists', + uponReceiving: 'a request for the pipeline header data', + }, + request: { method: 'POST', path: '/api/graphql', @@ -95,5 +98,3 @@ const PipelineHeaderData = { }; export { PipelineHeaderData }; - -/* eslint-enable @gitlab/require-i18n-strings */ diff --git a/spec/contracts/consumer/fixtures/project/pipeline_schedule/update_pipeline_schedule.fixture.js b/spec/contracts/consumer/fixtures/project/pipeline_schedule/update_pipeline_schedule.fixture.js new file mode 100644 index 00000000000..acfab14851a --- /dev/null +++ b/spec/contracts/consumer/fixtures/project/pipeline_schedule/update_pipeline_schedule.fixture.js @@ -0,0 +1,44 @@ +import { Matchers } from '@pact-foundation/pact'; +import { REDIRECT_HTML } from '../../../helpers/common_regex_patterns'; + +const body = Matchers.term({ + matcher: REDIRECT_HTML, + generate: + '<html><body>You are being <a href="http://example.org/gitlab-org/gitlab-qa/-/pipelines/5">redirected</a>.</body></html>', +}); + +const UpdatePipelineSchedule = { + success: { + status: 302, + headers: { + 'Content-Type': 'text/html; charset=utf-8', + }, + body, + }, + + scenario: { + state: 'a project with a pipeline schedule exists', + uponReceiving: 'a request to edit a pipeline schedule', + }, + + request: { + withRequest: { + method: 'PUT', + path: '/gitlab-org/gitlab-qa/-/pipeline_schedules/25', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json; charset=utf-8', + }, + body: { + schedule: { + description: 'bar', + cron: '0 1 * * *', + cron_timezone: 'UTC', + active: true, + }, + }, + }, + }, +}; + +export { UpdatePipelineSchedule }; |