aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-08 21:16:10 +0100
committerGitHub <noreply@github.com>2020-12-08 21:16:10 +0100
commitf2eb23cd87cf32b8fe545178143b5f49e06a58da (patch)
treeaf7d59945af70e28fd85047e2c688c59a908f548 /server/tests/api/check-params/videos.ts
parentc977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff)
downloadPeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.gz
PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.zst
PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.zip
emit more specific status codes on video upload (#3423)
- reduce http status codes list to potentially useful codes - convert more codes to typed ones - factorize html generator for error responses
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r--server/tests/api/check-params/videos.ts18
1 files changed, 16 insertions, 2 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index d60546917..5faba82c4 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -348,12 +348,26 @@ describe('Test videos API validator', function () {
348 let attaches = { 348 let attaches = {
349 videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short_fake.webm') 349 videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short_fake.webm')
350 } 350 }
351 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 351 await makeUploadRequest({
352 url: server.url,
353 path: path + '/upload',
354 token: server.accessToken,
355 fields,
356 attaches,
357 statusCodeExpected: HttpStatusCode.UNPROCESSABLE_ENTITY_422
358 })
352 359
353 attaches = { 360 attaches = {
354 videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mkv') 361 videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mkv')
355 } 362 }
356 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 363 await makeUploadRequest({
364 url: server.url,
365 path: path + '/upload',
366 token: server.accessToken,
367 fields,
368 attaches,
369 statusCodeExpected: HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415
370 })
357 }) 371 })
358 372
359 it('Should fail with an incorrect thumbnail file', async function () { 373 it('Should fail with an incorrect thumbnail file', async function () {