aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 14:41:55 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 15:16:39 +0100
commit7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88 (patch)
treeed94c1fb00a85a1f25c15b9a82831f4999e72948 /server/tests/api/check-params/videos.ts
parent6913f69134947432a192890b2de7c2d48094e85c (diff)
downloadPeerTube-7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88.tar.gz
PeerTube-7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88.tar.zst
PeerTube-7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88.zip
Add originallyPublishedAt unit tests
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r--server/tests/api/check-params/videos.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index 878ffe025..3eccaee44 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -185,7 +185,8 @@ describe('Test videos API validator', function () {
185 support: 'my super support text', 185 support: 'my super support text',
186 tags: [ 'tag1', 'tag2' ], 186 tags: [ 'tag1', 'tag2' ],
187 privacy: VideoPrivacy.PUBLIC, 187 privacy: VideoPrivacy.PUBLIC,
188 channelId: channelId 188 channelId: channelId,
189 originallyPublishedAt: new Date().toISOString()
189 } 190 }
190 }) 191 })
191 192
@@ -313,6 +314,13 @@ describe('Test videos API validator', function () {
313 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 314 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
314 }) 315 })
315 316
317 it('Should fail with a bad originally published at attribute', async function () {
318 const fields = immutableAssign(baseCorrectParams, { 'originallyPublishedAt': 'toto' })
319 const attaches = baseCorrectAttaches
320
321 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
322 })
323
316 it('Should fail without an input file', async function () { 324 it('Should fail without an input file', async function () {
317 const fields = baseCorrectParams 325 const fields = baseCorrectParams
318 const attaches = {} 326 const attaches = {}
@@ -534,6 +542,12 @@ describe('Test videos API validator', function () {
534 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) 542 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
535 }) 543 })
536 544
545 it('Should fail with a bad originally published at param', async function () {
546 const fields = immutableAssign(baseCorrectParams, { originallyPublishedAt: 'toto' })
547
548 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
549 })
550
537 it('Should fail with an incorrect thumbnail file', async function () { 551 it('Should fail with an incorrect thumbnail file', async function () {
538 const fields = baseCorrectParams 552 const fields = baseCorrectParams
539 const attaches = { 553 const attaches = {