aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-comments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/video-comments.ts')
-rw-r--r--server/tests/api/check-params/video-comments.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index bdf7f91ee..44af9d7e3 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -38,26 +38,26 @@ describe('Test video comments API validator', function () {
38 await setAccessTokensToServers([ server ]) 38 await setAccessTokensToServers([ server ])
39 39
40 { 40 {
41 const video = await server.videosCommand.upload({ attributes: {} }) 41 const video = await server.videos.upload({ attributes: {} })
42 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads' 42 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads'
43 } 43 }
44 44
45 { 45 {
46 const created = await server.commentsCommand.createThread({ videoId: video.uuid, text: 'coucou' }) 46 const created = await server.comments.createThread({ videoId: video.uuid, text: 'coucou' })
47 commentId = created.id 47 commentId = created.id
48 pathComment = '/api/v1/videos/' + video.uuid + '/comments/' + commentId 48 pathComment = '/api/v1/videos/' + video.uuid + '/comments/' + commentId
49 } 49 }
50 50
51 { 51 {
52 const user = { username: 'user1', password: 'my super password' } 52 const user = { username: 'user1', password: 'my super password' }
53 await server.usersCommand.create({ username: user.username, password: user.password }) 53 await server.users.create({ username: user.username, password: user.password })
54 userAccessToken = await server.loginCommand.getAccessToken(user) 54 userAccessToken = await server.login.getAccessToken(user)
55 } 55 }
56 56
57 { 57 {
58 const user = { username: 'user2', password: 'my super password' } 58 const user = { username: 'user2', password: 'my super password' }
59 await server.usersCommand.create({ username: user.username, password: user.password }) 59 await server.users.create({ username: user.username, password: user.password })
60 userAccessToken2 = await server.loginCommand.getAccessToken(user) 60 userAccessToken2 = await server.login.getAccessToken(user)
61 } 61 }
62 }) 62 })
63 63
@@ -274,7 +274,7 @@ describe('Test video comments API validator', function () {
274 let commentToDelete: number 274 let commentToDelete: number
275 275
276 { 276 {
277 const created = await server.commentsCommand.createThread({ videoId: video.uuid, token: userAccessToken, text: 'hello' }) 277 const created = await server.comments.createThread({ videoId: video.uuid, token: userAccessToken, text: 'hello' })
278 commentToDelete = created.id 278 commentToDelete = created.id
279 } 279 }
280 280
@@ -289,12 +289,12 @@ describe('Test video comments API validator', function () {
289 let anotherVideoUUID: string 289 let anotherVideoUUID: string
290 290
291 { 291 {
292 const { uuid } = await server.videosCommand.upload({ token: userAccessToken, attributes: { name: 'video' } }) 292 const { uuid } = await server.videos.upload({ token: userAccessToken, attributes: { name: 'video' } })
293 anotherVideoUUID = uuid 293 anotherVideoUUID = uuid
294 } 294 }
295 295
296 { 296 {
297 const created = await server.commentsCommand.createThread({ videoId: anotherVideoUUID, text: 'hello' }) 297 const created = await server.comments.createThread({ videoId: anotherVideoUUID, text: 'hello' })
298 commentToDelete = created.id 298 commentToDelete = created.id
299 } 299 }
300 300
@@ -316,7 +316,7 @@ describe('Test video comments API validator', function () {
316 316
317 describe('When a video has comments disabled', function () { 317 describe('When a video has comments disabled', function () {
318 before(async function () { 318 before(async function () {
319 video = await server.videosCommand.upload({ attributes: { commentsEnabled: false } }) 319 video = await server.videos.upload({ attributes: { commentsEnabled: false } })
320 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads' 320 pathThread = '/api/v1/videos/' + video.uuid + '/comment-threads'
321 }) 321 })
322 322