X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideos.ts;h=188d1835c17446ce4e83c3bd2767b0da818c2d34;hb=a786d8a08bf99f339bf16808f46e160404497ae2;hp=d605469174cc0339690bb9814fdd139858281af8;hpb=2d53be0267acc49cda46707b885096193a1f4e9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index d60546917..188d1835c 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -348,18 +348,32 @@ describe('Test videos API validator', function () { let attaches = { videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short_fake.webm') } - await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) + await makeUploadRequest({ + url: server.url, + path: path + '/upload', + token: server.accessToken, + fields, + attaches, + statusCodeExpected: HttpStatusCode.UNPROCESSABLE_ENTITY_422 + }) attaches = { videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mkv') } - await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) + await makeUploadRequest({ + url: server.url, + path: path + '/upload', + token: server.accessToken, + fields, + attaches, + statusCodeExpected: HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415 + }) }) it('Should fail with an incorrect thumbnail file', async function () { const fields = baseCorrectParams const attaches = { - thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), + thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4'), videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } @@ -369,7 +383,7 @@ describe('Test videos API validator', function () { it('Should fail with a big thumbnail file', async function () { const fields = baseCorrectParams const attaches = { - thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), + thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png'), videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } @@ -379,7 +393,7 @@ describe('Test videos API validator', function () { it('Should fail with an incorrect preview file', async function () { const fields = baseCorrectParams const attaches = { - previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), + previewfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4'), videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } @@ -389,7 +403,7 @@ describe('Test videos API validator', function () { it('Should fail with a big preview file', async function () { const fields = baseCorrectParams const attaches = { - previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), + previewfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png'), videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } @@ -567,7 +581,7 @@ describe('Test videos API validator', function () { it('Should fail with an incorrect thumbnail file', async function () { const fields = baseCorrectParams const attaches = { - thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png') + thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } await makeUploadRequest({ @@ -583,7 +597,7 @@ describe('Test videos API validator', function () { it('Should fail with a big thumbnail file', async function () { const fields = baseCorrectParams const attaches = { - thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') + thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png') } await makeUploadRequest({ @@ -599,7 +613,7 @@ describe('Test videos API validator', function () { it('Should fail with an incorrect preview file', async function () { const fields = baseCorrectParams const attaches = { - previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png') + previewfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') } await makeUploadRequest({ @@ -615,7 +629,7 @@ describe('Test videos API validator', function () { it('Should fail with a big preview file', async function () { const fields = baseCorrectParams const attaches = { - previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') + previewfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png') } await makeUploadRequest({