diff options
Diffstat (limited to 'spec/contracts/consumer/resources/api/project')
-rw-r--r-- | spec/contracts/consumer/resources/api/project/merge_requests.js | 34 | ||||
-rw-r--r-- | spec/contracts/consumer/resources/api/project/pipelines.js | 34 |
2 files changed, 68 insertions, 0 deletions
diff --git a/spec/contracts/consumer/resources/api/project/merge_requests.js b/spec/contracts/consumer/resources/api/project/merge_requests.js new file mode 100644 index 00000000000..e52743cede2 --- /dev/null +++ b/spec/contracts/consumer/resources/api/project/merge_requests.js @@ -0,0 +1,34 @@ +import axios from 'axios'; + +export async function getDiffsMetadata(endpoint) { + const { url } = endpoint; + + return axios({ + method: 'GET', + baseURL: url, + url: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_metadata.json', + headers: { Accept: '*/*' }, + }).then((response) => response.data); +} + +export async function getDiscussions(endpoint) { + const { url } = endpoint; + + return axios({ + method: 'GET', + baseURL: url, + url: '/gitlab-org/gitlab-qa/-/merge_requests/1/discussions.json', + headers: { Accept: '*/*' }, + }).then((response) => response.data); +} + +export async function getDiffsBatch(endpoint) { + const { url } = endpoint; + + return axios({ + method: 'GET', + baseURL: url, + url: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_batch.json?page=0', + headers: { Accept: '*/*' }, + }).then((response) => response.data); +} diff --git a/spec/contracts/consumer/resources/api/project/pipelines.js b/spec/contracts/consumer/resources/api/project/pipelines.js new file mode 100644 index 00000000000..8c6f5199666 --- /dev/null +++ b/spec/contracts/consumer/resources/api/project/pipelines.js @@ -0,0 +1,34 @@ +import axios from 'axios'; + +export async function getProjectPipelines(endpoint) { + const { url } = endpoint; + + return axios({ + method: 'GET', + baseURL: url, + url: '/gitlab-org/gitlab-qa/-/pipelines.json', + headers: { Accept: '*/*' }, + params: { + scope: 'all', + page: 1, + }, + }).then((response) => response.data); +} + +export async function postProjectPipelines(endpoint) { + const { url } = endpoint; + + return axios({ + method: 'POST', + baseURL: url, + url: '/gitlab-org/gitlab-qa/-/pipelines', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json; charset=utf-8', + }, + data: { ref: 'master' }, + validateStatus: (status) => { + return status === 302; + }, + }); +} |