debian-mirror-gitlab/spec/contracts/consumer/specs/project/pipeline_schedules/edit.spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-08-27 11:52:29 +05:30
import { pactWith } from 'jest-pact';
2023-03-04 22:38:38 +05:30
import { UpdatePipelineSchedule } from '../../../fixtures/project/pipeline_schedules/update_pipeline_schedule.fixture';
2022-08-27 11:52:29 +05:30
import { updatePipelineSchedule } from '../../../resources/api/pipeline_schedules';
const CONSUMER_NAME = 'PipelineSchedules#edit';
const CONSUMER_LOG = '../logs/consumer.log';
2023-03-04 22:38:38 +05:30
const CONTRACT_DIR = '../contracts/project/pipeline_schedules/edit';
const PROVIDER_NAME = 'PUT edit a pipeline schedule';
2022-08-27 11:52:29 +05:30
// API endpoint: /pipelines.json
pactWith(
{
consumer: CONSUMER_NAME,
provider: PROVIDER_NAME,
log: CONSUMER_LOG,
dir: CONTRACT_DIR,
},
(provider) => {
describe(PROVIDER_NAME, () => {
beforeEach(() => {
const interaction = {
...UpdatePipelineSchedule.scenario,
...UpdatePipelineSchedule.request,
willRespondWith: UpdatePipelineSchedule.success,
};
provider.addInteraction(interaction);
});
it('returns a successful body', async () => {
const pipelineSchedule = await updatePipelineSchedule({
url: provider.mockService.baseUrl,
});
expect(pipelineSchedule.status).toEqual(UpdatePipelineSchedule.success.status);
});
});
},
);