aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-27 10:26:52 +0200
committerChocobozzz <me@florianbigard.com>2018-03-27 11:11:15 +0200
commit73c0809326670867642f8a36f68d8564e0e406b5 (patch)
treeb2849106a252f8b2108318d90767dcb747d9dd6c /server/tests/api/videos
parent649f0334e0673a28d1674aa82de29326fa3cdb63 (diff)
downloadPeerTube-73c0809326670867642f8a36f68d8564e0e406b5.tar.gz
PeerTube-73c0809326670867642f8a36f68d8564e0e406b5.tar.zst
PeerTube-73c0809326670867642f8a36f68d8564e0e406b5.zip
Fix delete comment federation
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/multiple-servers.ts31
1 files changed, 30 insertions, 1 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 74c6b8462..e31c7febd 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -728,6 +728,8 @@ describe('Test multiple servers', function () {
728 }) 728 })
729 729
730 describe('Should comment these videos', function () { 730 describe('Should comment these videos', function () {
731 let childOfFirstChild: VideoCommentThreadTree
732
731 it('Should add comment (threads and replies)', async function () { 733 it('Should add comment (threads and replies)', async function () {
732 this.timeout(25000) 734 this.timeout(25000)
733 735
@@ -821,7 +823,7 @@ describe('Test multiple servers', function () {
821 expect(firstChild.comment.account.host).equal('localhost:9002') 823 expect(firstChild.comment.account.host).equal('localhost:9002')
822 expect(firstChild.children).to.have.lengthOf(1) 824 expect(firstChild.children).to.have.lengthOf(1)
823 825
824 const childOfFirstChild = firstChild.children[0] 826 childOfFirstChild = firstChild.children[0]
825 expect(childOfFirstChild.comment.text).to.equal('my super answer to answer of thread 1') 827 expect(childOfFirstChild.comment.text).to.equal('my super answer to answer of thread 1')
826 expect(childOfFirstChild.comment.account.name).equal('root') 828 expect(childOfFirstChild.comment.account.name).equal('root')
827 expect(childOfFirstChild.comment.account.host).equal('localhost:9003') 829 expect(childOfFirstChild.comment.account.host).equal('localhost:9003')
@@ -835,6 +837,33 @@ describe('Test multiple servers', function () {
835 } 837 }
836 }) 838 })
837 839
840 it('Should delete a reply', async function () {
841 this.timeout(10000)
842
843 await deleteVideoComment(servers[2].url, servers[2].accessToken, videoUUID, childOfFirstChild.comment.id)
844
845 await wait(5000)
846 })
847
848 it('Should not have this comment anymore', async function () {
849 for (const server of servers) {
850 const res1 = await getVideoCommentThreads(server.url, videoUUID, 0, 5)
851 const threadId = res1.body.data.find(c => c.text === 'my super first comment').id
852
853 const res2 = await getVideoThreadComments(server.url, videoUUID, threadId)
854
855 const tree: VideoCommentThreadTree = res2.body
856 expect(tree.comment.text).equal('my super first comment')
857
858 const firstChild = tree.children[0]
859 expect(firstChild.comment.text).to.equal('my super answer to thread 1')
860 expect(firstChild.children).to.have.lengthOf(0)
861
862 const secondChild = tree.children[1]
863 expect(secondChild.comment.text).to.equal('my second answer to thread 1')
864 }
865 })
866
838 it('Should delete the thread comments', async function () { 867 it('Should delete the thread comments', async function () {
839 this.timeout(10000) 868 this.timeout(10000)
840 869