From 0b96a0fb77cee07abac185fb1fb704388498631b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 12 Jan 2023 11:11:30 +0100 Subject: Optimize again comments list sql query --- server/tests/api/videos/video-comments.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/tests/api') diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index e077cbf73..e35500b0b 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts @@ -169,6 +169,13 @@ describe('Test video comments', function () { expect(body.data[2].totalReplies).to.equal(0) }) + it('Should list the and sort them by total replies', async function () { + const body = await command.listThreads({ videoId: videoUUID, sort: 'totalReplies' }) + + expect(body.data[2].text).to.equal('my super first comment') + expect(body.data[2].totalReplies).to.equal(3) + }) + it('Should delete a reply', async function () { await command.delete({ videoId, commentId: replyToDeleteId }) -- cgit v1.2.3