aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-comments.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-15 10:02:54 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch)
treeda82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/check-params/video-comments.ts
parent7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff)
downloadPeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip
Introduce videos command
Diffstat (limited to 'server/tests/api/check-params/video-comments.ts')
-rw-r--r--server/tests/api/check-params/video-comments.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index b7656a176..bdf7f91ee 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -13,8 +13,7 @@ import {
13 makeGetRequest, 13 makeGetRequest,
14 makePostBodyRequest, 14 makePostBodyRequest,
15 ServerInfo, 15 ServerInfo,
16 setAccessTokensToServers, 16 setAccessTokensToServers
17 uploadVideo
18} from '@shared/extra-utils' 17} from '@shared/extra-utils'
19import { VideoCreateResult } from '@shared/models' 18import { VideoCreateResult } from '@shared/models'
20 19
@@ -39,8 +38,7 @@ describe('Test video comments API validator', function () {
39 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
40 39
41 { 40 {
42 const res = await uploadVideo(server.url, server.accessToken, {}) 41 const video = await server.videosCommand.upload({ attributes: {} })
43 video = res.body.video
44 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads' 42 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads'
45 } 43 }
46 44
@@ -291,8 +289,8 @@ describe('Test video comments API validator', function () {
291 let anotherVideoUUID: string 289 let anotherVideoUUID: string
292 290
293 { 291 {
294 const res = await uploadVideo(server.url, userAccessToken, { name: 'video' }) 292 const { uuid } = await server.videosCommand.upload({ token: userAccessToken, attributes: { name: 'video' } })
295 anotherVideoUUID = res.body.video.uuid 293 anotherVideoUUID = uuid
296 } 294 }
297 295
298 { 296 {
@@ -318,8 +316,7 @@ describe('Test video comments API validator', function () {
318 316
319 describe('When a video has comments disabled', function () { 317 describe('When a video has comments disabled', function () {
320 before(async function () { 318 before(async function () {
321 const res = await uploadVideo(server.url, server.accessToken, { commentsEnabled: false }) 319 video = await server.videosCommand.upload({ attributes: { commentsEnabled: false } })
322 video = res.body.video
323 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads' 320 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads'
324 }) 321 })
325 322