diff options
Diffstat (limited to 'server/tests/api/videos/multiple-servers.ts')
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index b6dfe0d1b..6712829d4 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | updateVideo, uploadVideo, userLogin, viewVideo, wait, webtorrentAdd | 13 | updateVideo, uploadVideo, userLogin, viewVideo, wait, webtorrentAdd |
14 | } from '../../utils' | 14 | } from '../../utils' |
15 | import { | 15 | import { |
16 | addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, | 16 | addVideoCommentReply, addVideoCommentThread, deleteVideoComment, getVideoCommentThreads, |
17 | getVideoThreadComments | 17 | getVideoThreadComments |
18 | } from '../../utils/videos/video-comments' | 18 | } from '../../utils/videos/video-comments' |
19 | 19 | ||
@@ -738,6 +738,37 @@ describe('Test multiple servers', function () { | |||
738 | } | 738 | } |
739 | }) | 739 | }) |
740 | 740 | ||
741 | it('Should delete the thread comments', async function () { | ||
742 | this.timeout(10000) | ||
743 | |||
744 | const res1 = await getVideoCommentThreads(servers[0].url, videoUUID, 0, 5) | ||
745 | const threadId = res1.body.data.find(c => c.text === 'my super first comment').id | ||
746 | await deleteVideoComment(servers[0].url, servers[0].accessToken, videoUUID, threadId) | ||
747 | |||
748 | await wait(5000) | ||
749 | }) | ||
750 | |||
751 | it('Should have the thread comments deleted on other servers too', async function () { | ||
752 | for (const server of servers) { | ||
753 | const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) | ||
754 | |||
755 | expect(res.body.total).to.equal(1) | ||
756 | expect(res.body.data).to.be.an('array') | ||
757 | expect(res.body.data).to.have.lengthOf(1) | ||
758 | |||
759 | { | ||
760 | const comment: VideoComment = res.body.data[0] | ||
761 | expect(comment).to.not.be.undefined | ||
762 | expect(comment.inReplyToCommentId).to.be.null | ||
763 | expect(comment.account.name).to.equal('root') | ||
764 | expect(comment.account.host).to.equal('localhost:9003') | ||
765 | expect(comment.totalReplies).to.equal(0) | ||
766 | expect(dateIsValid(comment.createdAt as string)).to.be.true | ||
767 | expect(dateIsValid(comment.updatedAt as string)).to.be.true | ||
768 | } | ||
769 | } | ||
770 | }) | ||
771 | |||
741 | it('Should disable comments', async function () { | 772 | it('Should disable comments', async function () { |
742 | this.timeout(20000) | 773 | this.timeout(20000) |
743 | 774 | ||