diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js')
-rw-r--r-- | spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js b/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js new file mode 100644 index 00000000000..af0962a01cb --- /dev/null +++ b/spec/contracts/consumer/fixtures/project/merge_request/discussions.fixture.js @@ -0,0 +1,87 @@ +/* eslint-disable @gitlab/require-i18n-strings */ + +import { Matchers } from '@pact-foundation/pact'; + +const body = Matchers.eachLike({ + id: Matchers.string('fd73763cbcbf7b29eb8765d969a38f7d735e222a'), + reply_id: Matchers.string('fd73763cbcbf7b29eb8765d969a38f7d735e222a'), + project_id: Matchers.integer(6954442), + confidential: Matchers.boolean(false), + diff_discussion: Matchers.boolean(false), + expanded: Matchers.boolean(false), + for_commit: Matchers.boolean(false), + individual_note: Matchers.boolean(true), + resolvable: Matchers.boolean(false), + resolved_by_push: Matchers.boolean(false), + notes: Matchers.eachLike({ + id: Matchers.string('76489845'), + author: { + id: Matchers.integer(1675733), + username: Matchers.string('gitlab-qa-bot'), + name: Matchers.string('gitlab-qa-bot'), + state: Matchers.string('active'), + avatar_url: Matchers.string( + 'https://secure.gravatar.com/avatar/8355ad0f2761367fae6b9c4fe80994b9?s=80&d=identicon', + ), + show_status: Matchers.boolean(false), + path: Matchers.string('/gitlab-qa-bot'), + }, + created_at: Matchers.iso8601DateTimeWithMillis('2022-02-22T07:06:55.038Z'), + updated_at: Matchers.iso8601DateTimeWithMillis('2022-02-22T07:06:55.038Z'), + system: Matchers.boolean(false), + noteable_id: Matchers.integer(8333422), + noteable_type: Matchers.string('MergeRequest'), + resolvable: Matchers.boolean(false), + resolved: Matchers.boolean(true), + confidential: Matchers.boolean(false), + noteable_iid: Matchers.integer(1), + note: Matchers.string('This is a test comment'), + note_html: Matchers.string( + '<p data-sourcepos="1:1-1:22" dir="auto">This is a test comment</p>', + ), + current_user: { + can_edit: Matchers.boolean(true), + can_award_emoji: Matchers.boolean(true), + can_resolve: Matchers.boolean(false), + can_resolve_discussion: Matchers.boolean(false), + }, + is_noteable_author: Matchers.boolean(true), + discussion_id: Matchers.string('fd73763cbcbf7b29eb8765d969a38f7d735e222a'), + emoji_awardable: Matchers.boolean(true), + report_abuse_path: Matchers.string('/gitlab-qa-bot/...'), + noteable_note_url: Matchers.string('https://staging.gitlab.com/gitlab-qa-bot/...'), + cached_markdown_version: Matchers.integer(1900552), + human_access: Matchers.string('Maintainer'), + is_contributor: Matchers.boolean(false), + project_name: Matchers.string('contract-testing'), + path: Matchers.string('/gitlab-qa-bot/...'), + }), + resolved: Matchers.boolean(true), +}); + +const Discussions = { + body: Matchers.extractPayload(body), + + success: { + status: 200, + headers: { + 'Content-Type': 'application/json; charset=utf-8', + }, + body, + }, + + request: { + uponReceiving: 'a request for discussions', + withRequest: { + method: 'GET', + path: '/gitlab-org/gitlab-qa/-/merge_requests/1/discussions.json', + headers: { + Accept: '*/*', + }, + }, + }, +}; + +export { Discussions }; + +/* eslint-enable @gitlab/require-i18n-strings */ |