]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/videos.ts
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / videos.ts
index d605469174cc0339690bb9814fdd139858281af8..188d1835c17446ce4e83c3bd2767b0da818c2d34 100644 (file)
@@ -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({