aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-comments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/videos/video-comments.ts')
-rw-r--r--server/tests/api/videos/video-comments.ts23
1 files changed, 21 insertions, 2 deletions
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts
index 5485b72ec..e077cbf73 100644
--- a/server/tests/api/videos/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -38,6 +38,8 @@ describe('Test video comments', function () {
38 await setDefaultAccountAvatar(server) 38 await setDefaultAccountAvatar(server)
39 39
40 userAccessTokenServer1 = await server.users.generateUserAndToken('user1') 40 userAccessTokenServer1 = await server.users.generateUserAndToken('user1')
41 await setDefaultChannelAvatar(server, 'user1_channel')
42 await setDefaultAccountAvatar(server, userAccessTokenServer1)
41 43
42 command = server.comments 44 command = server.comments
43 }) 45 })
@@ -240,9 +242,26 @@ describe('Test video comments', function () {
240 describe('All instance comments', function () { 242 describe('All instance comments', function () {
241 243
242 it('Should list instance comments as admin', async function () { 244 it('Should list instance comments as admin', async function () {
243 const { data } = await command.listForAdmin({ start: 0, count: 1 }) 245 {
246 const { data, total } = await command.listForAdmin({ start: 0, count: 1 })
244 247
245 expect(data[0].text).to.equal('my second answer to thread 4') 248 expect(total).to.equal(7)
249 expect(data).to.have.lengthOf(1)
250 expect(data[0].text).to.equal('my second answer to thread 4')
251 expect(data[0].account.name).to.equal('root')
252 expect(data[0].account.displayName).to.equal('root')
253 expect(data[0].account.avatars).to.have.lengthOf(2)
254 }
255
256 {
257 const { data, total } = await command.listForAdmin({ start: 1, count: 2 })
258
259 expect(total).to.equal(7)
260 expect(data).to.have.lengthOf(2)
261
262 expect(data[0].account.avatars).to.have.lengthOf(2)
263 expect(data[1].account.avatars).to.have.lengthOf(2)
264 }
246 }) 265 })
247 266
248 it('Should filter instance comments by isLocal', async function () { 267 it('Should filter instance comments by isLocal', async function () {