aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-01-10 09:16:33 +0100
committerChocobozzz <me@florianbigard.com>2023-01-10 09:17:23 +0100
commita8749f7c3b137f433e6944bb99fd721a6f0cfc1e (patch)
tree88046c0bfc69728f98dca7bcde4aa7e7d1308591 /server/tests
parent57f255bebc2f55fd152c70b05b8de54e5e77da61 (diff)
downloadPeerTube-a8749f7c3b137f433e6944bb99fd721a6f0cfc1e.tar.gz
PeerTube-a8749f7c3b137f433e6944bb99fd721a6f0cfc1e.tar.zst
PeerTube-a8749f7c3b137f433e6944bb99fd721a6f0cfc1e.zip
Fix comments SQL pagination
Diffstat (limited to 'server/tests')
-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 () {