aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-15 16:52:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-15 18:20:56 +0200
commitbbe0f0645ca958d33a3f409b15166609733b663f (patch)
treeedcd5d702c73cda74a2177c4bdc08c616334337d /server/tests/api/check-params
parent2baea0c77cc765f7cbca9c9a2f4272268892a35c (diff)
downloadPeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.gz
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.zst
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.zip
Add ability to schedule video publication
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/videos.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index 04bed3b44..abbea6ba3 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -291,6 +291,23 @@ describe('Test videos API validator', function () {
291 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 291 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
292 }) 292 })
293 293
294 it('Should fail with a bad schedule update (miss updateAt)', async function () {
295 const fields = immutableAssign(baseCorrectParams, { 'scheduleUpdate[privacy]': VideoPrivacy.PUBLIC })
296 const attaches = baseCorrectAttaches
297
298 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
299 })
300
301 it('Should fail with a bad schedule update (wrong updateAt)', async function () {
302 const fields = immutableAssign(baseCorrectParams, {
303 'scheduleUpdate[privacy]': VideoPrivacy.PUBLIC,
304 'scheduleUpdate[updateAt]': 'toto'
305 })
306 const attaches = baseCorrectAttaches
307
308 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
309 })
310
294 it('Should fail without an input file', async function () { 311 it('Should fail without an input file', async function () {
295 const fields = baseCorrectParams 312 const fields = baseCorrectParams
296 const attaches = {} 313 const attaches = {}
@@ -494,6 +511,18 @@ describe('Test videos API validator', function () {
494 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) 511 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
495 }) 512 })
496 513
514 it('Should fail with a bad schedule update (miss updateAt)', async function () {
515 const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { privacy: VideoPrivacy.PUBLIC } })
516
517 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
518 })
519
520 it('Should fail with a bad schedule update (wrong updateAt)', async function () {
521 const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { updateAt: 'toto', privacy: VideoPrivacy.PUBLIC } })
522
523 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
524 })
525
497 it('Should fail with an incorrect thumbnail file', async function () { 526 it('Should fail with an incorrect thumbnail file', async function () {
498 const fields = baseCorrectParams 527 const fields = baseCorrectParams
499 const attaches = { 528 const attaches = {