]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/videos.ts
Implement support field in video and video channel
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / videos.ts
index aa30b721ba5d18b049085a0eaab07b022f59a3e9..1d5c8543d2dba5fb1ead5cbeac52786f6183d5b9 100644 (file)
@@ -102,6 +102,7 @@ describe('Test videos API validator', function () {
         nsfw: false,
         commentsEnabled: true,
         description: 'my super description',
+        support: 'my super support text',
         tags: [ 'tag1', 'tag2' ],
         privacy: VideoPrivacy.PUBLIC,
         channelId
@@ -178,7 +179,14 @@ describe('Test videos API validator', function () {
     })
 
     it('Should fail with a long description', async function () {
-      const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) })
+      const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(2500) })
+      const attaches = baseCorrectAttaches
+
+      await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+    })
+
+    it('Should fail with a long support text', async function () {
+      const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(70) })
       const attaches = baseCorrectAttaches
 
       await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -417,7 +425,13 @@ describe('Test videos API validator', function () {
     })
 
     it('Should fail with a long description', async function () {
-      const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) })
+      const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(2500) })
+
+      await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
+    })
+
+    it('Should fail with a long support text', async function () {
+      const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(70) })
 
       await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
     })