aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 11:52:34 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 11:52:34 +0100
commit88108880bbdba473cfe36ecbebc1c3c4f972e102 (patch)
treeb242efb3b4f0d7e49d88f2d1f2063b5b3b0489c0 /server/tests/api/check-params/videos.ts
parent53a94c7cfa8368da4cd248d65df8346905938f0c (diff)
parent9b712a2017e4ab3cf12cd6bd58278905520159d0 (diff)
downloadPeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.gz
PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.zst
PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.zip
Merge branch 'develop' into pr/1217
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r--server/tests/api/check-params/videos.ts21
1 files changed, 15 insertions, 6 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index bc28e2422..878ffe025 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -8,9 +8,13 @@ import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enu
8import { 8import {
9 createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest, 9 createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
10 makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin 10 makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin
11} from '../../utils' 11} from '../../../../shared/utils'
12import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params' 12import {
13import { getAccountsList } from '../../utils/users/accounts' 13 checkBadCountPagination,
14 checkBadSortPagination,
15 checkBadStartPagination
16} from '../../../../shared/utils/requests/check-api-params'
17import { getAccountsList } from '../../../../shared/utils/users/accounts'
14 18
15const expect = chai.expect 19const expect = chai.expect
16 20
@@ -234,7 +238,7 @@ describe('Test videos API validator', function () {
234 }) 238 })
235 239
236 it('Should fail with a long support text', async function () { 240 it('Should fail with a long support text', async function () {
237 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) 241 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
238 const attaches = baseCorrectAttaches 242 const attaches = baseCorrectAttaches
239 243
240 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 244 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
@@ -317,10 +321,15 @@ describe('Test videos API validator', function () {
317 321
318 it('Should fail without an incorrect input file', async function () { 322 it('Should fail without an incorrect input file', async function () {
319 const fields = baseCorrectParams 323 const fields = baseCorrectParams
320 const attaches = { 324 let attaches = {
321 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm') 325 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
322 } 326 }
323 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) 327 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
328
329 attaches = {
330 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mkv')
331 }
332 await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
324 }) 333 })
325 334
326 it('Should fail with an incorrect thumbnail file', async function () { 335 it('Should fail with an incorrect thumbnail file', async function () {
@@ -484,7 +493,7 @@ describe('Test videos API validator', function () {
484 }) 493 })
485 494
486 it('Should fail with a long support text', async function () { 495 it('Should fail with a long support text', async function () {
487 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) 496 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
488 497
489 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) 498 await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
490 }) 499 })