aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/multiple-servers.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-04 11:19:16 +0100
committerChocobozzz <me@florianbigard.com>2018-01-04 11:19:16 +0100
commit4cb6d4578893db310297d7e118ce2fb7ecb952a3 (patch)
treea89a2e2062ba7bb91e922f07a7950ee51e090ccf /server/tests/api/videos/multiple-servers.ts
parentcf117aaafc1e9ae1ab4c388fc5d2e5ba9349efee (diff)
downloadPeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.gz
PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.tar.zst
PeerTube-4cb6d4578893db310297d7e118ce2fb7ecb952a3.zip
Add ability to delete comments
Diffstat (limited to 'server/tests/api/videos/multiple-servers.ts')
-rw-r--r--server/tests/api/videos/multiple-servers.ts33
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'
15import { 15import {
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