summaryrefslogtreecommitdiff
path: root/spec/frontend/api_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:11:53 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:11:53 +0000
commit7ea46a9866101f15734b557d812bb52d347f63fb (patch)
treec752e2f04dab642e8b3d8d026dd530a7d4c1f229 /spec/frontend/api_spec.js
parent889bf7a0eea1f4ac7c2ec28cdfded399c0ca8fb9 (diff)
downloadgitlab-ce-7ea46a9866101f15734b557d812bb52d347f63fb.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.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index d6e1b170dd3..f875e3bdb07 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -1382,6 +1382,38 @@ describe('Api', () => {
});
});
+ describe('updateFreezePeriod', () => {
+ const options = {
+ id: 10,
+ freeze_start: '* * * * *',
+ freeze_end: '* * * * *',
+ cron_timezone: 'America/Juneau',
+ created_at: '2020-07-11T07:04:50.153Z',
+ updated_at: '2020-07-11T07:04:50.153Z',
+ };
+ const projectId = 8;
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/freeze_periods/${options.id}`;
+
+ const expectedResult = {
+ id: 10,
+ freeze_start: '* * * * *',
+ freeze_end: '* * * * *',
+ cron_timezone: 'America/Juneau',
+ created_at: '2020-07-11T07:04:50.153Z',
+ updated_at: '2020-07-11T07:04:50.153Z',
+ };
+
+ describe('when the freeze period is successfully updated', () => {
+ it('resolves the Promise', () => {
+ mock.onPut(expectedUrl, options).replyOnce(httpStatus.OK, expectedResult);
+
+ return Api.updateFreezePeriod(projectId, options).then(({ data }) => {
+ expect(data).toStrictEqual(expectedResult);
+ });
+ });
+ });
+ });
+
describe('createPipeline', () => {
it('creates new pipeline', () => {
const redirectUrl = 'ci-project/-/pipelines/95';