X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideos.ts;h=3eccaee443b7bfc34ffc3964e243cd6f149ba0c0;hb=7519127b5cb44095f78f6bf4c51d4ebf2b7d5e88;hp=878ffe0256a76a8f96d126b8a86983bda459dc88;hpb=6913f69134947432a192890b2de7c2d48094e85c;p=github%2FChocobozzz%2FPeerTube.git 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 () { support: 'my super support text', tags: [ 'tag1', 'tag2' ], privacy: VideoPrivacy.PUBLIC, - channelId: channelId + channelId: channelId, + originallyPublishedAt: new Date().toISOString() } }) @@ -313,6 +314,13 @@ describe('Test videos API validator', function () { await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) }) + it('Should fail with a bad originally published at attribute', async function () { + const fields = immutableAssign(baseCorrectParams, { 'originallyPublishedAt': 'toto' }) + const attaches = baseCorrectAttaches + + await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) + }) + it('Should fail without an input file', async function () { const fields = baseCorrectParams const attaches = {} @@ -534,6 +542,12 @@ describe('Test videos API validator', function () { await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) }) + it('Should fail with a bad originally published at param', async function () { + const fields = immutableAssign(baseCorrectParams, { originallyPublishedAt: 'toto' }) + + await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) + }) + it('Should fail with an incorrect thumbnail file', async function () { const fields = baseCorrectParams const attaches = {