summaryrefslogtreecommitdiff
path: root/spec/frontend/api_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-05 12:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-05 12:09:05 +0000
commita662b146aca7227bc800eed4878000d2b7c9d757 (patch)
tree8eb9906203b1fda105741b3cc1488a550ebf1962 /spec/frontend/api_spec.js
parent015890a1b77cd90e9ffeb704944d1fb63b0ce555 (diff)
downloadgitlab-ce-a662b146aca7227bc800eed4878000d2b7c9d757.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/api_spec.js')
-rw-r--r--spec/frontend/api_spec.js33
1 files changed, 16 insertions, 17 deletions
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index 7fdd0d7d6db..26ec399bc5f 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -710,24 +710,23 @@ describe('Api', () => {
});
describe('pipelineJobs', () => {
- it('fetches the jobs for a given pipeline', done => {
- const projectId = 123;
- const pipelineId = 456;
- const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/pipelines/${pipelineId}/jobs`;
- const payload = [
- {
- name: 'test',
- },
- ];
- mock.onGet(expectedUrl).reply(httpStatus.OK, payload);
+ it.each([undefined, {}, { foo: true }])(
+ 'fetches the jobs for a given pipeline given %p params',
+ async params => {
+ const projectId = 123;
+ const pipelineId = 456;
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/pipelines/${pipelineId}/jobs`;
+ const payload = [
+ {
+ name: 'test',
+ },
+ ];
+ mock.onGet(expectedUrl, { params }).reply(httpStatus.OK, payload);
- Api.pipelineJobs(projectId, pipelineId)
- .then(({ data }) => {
- expect(data).toEqual(payload);
- })
- .then(done)
- .catch(done.fail);
- });
+ const { data } = await Api.pipelineJobs(projectId, pipelineId, params);
+ expect(data).toEqual(payload);
+ },
+ );
});
describe('createBranch', () => {