From 511765c9f86fb07d5d856decd9dbf0ec2092f4fe Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Aug 2019 15:35:29 +0200 Subject: Remove comment federation by video owner --- server/tests/api/videos/multiple-servers.ts | 41 ++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index e811ccd8e..651765776 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -500,20 +500,18 @@ describe('Test multiple servers', function () { it('Should view multiple videos on owned servers', async function () { this.timeout(30000) - const tasks: Promise[] = [] - await viewVideo(servers[2].url, localVideosServer3[0]) - await viewVideo(servers[2].url, localVideosServer3[0]) await viewVideo(servers[2].url, localVideosServer3[0]) - await viewVideo(servers[2].url, localVideosServer3[1]) - - await Promise.all(tasks) - await waitJobs(servers) + await wait(1000) await viewVideo(servers[2].url, localVideosServer3[0]) + await viewVideo(servers[2].url, localVideosServer3[1]) - await waitJobs(servers) + await wait(1000) - await viewVideo(servers[2].url, localVideosServer3[0]) + await Promise.all([ + viewVideo(servers[2].url, localVideosServer3[0]), + viewVideo(servers[2].url, localVideosServer3[0]) + ]) await waitJobs(servers) @@ -894,14 +892,14 @@ describe('Test multiple servers', function () { it('Should delete the thread comments', async function () { this.timeout(10000) - const res1 = await getVideoCommentThreads(servers[0].url, videoUUID, 0, 5) - const threadId = res1.body.data.find(c => c.text === 'my super first comment').id - await deleteVideoComment(servers[0].url, servers[0].accessToken, videoUUID, threadId) + const res = await getVideoCommentThreads(servers[ 0 ].url, videoUUID, 0, 5) + const threadId = res.body.data.find(c => c.text === 'my super first comment').id + await deleteVideoComment(servers[ 0 ].url, servers[ 0 ].accessToken, videoUUID, threadId) await waitJobs(servers) }) - it('Should have the thread comments deleted on other servers too', async function () { + it('Should have the threads deleted on other servers too', async function () { for (const server of servers) { const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) @@ -922,6 +920,23 @@ describe('Test multiple servers', function () { } }) + it('Should delete a remote thread by the origin server', async function () { + const res = await getVideoCommentThreads(servers[ 0 ].url, videoUUID, 0, 5) + const threadId = res.body.data.find(c => c.text === 'my super second comment').id + await deleteVideoComment(servers[ 0 ].url, servers[ 0 ].accessToken, videoUUID, threadId) + + await waitJobs(servers) + }) + + it('Should have the threads deleted on other servers too', async function () { + for (const server of servers) { + const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) + + expect(res.body.total).to.equal(0) + expect(res.body.data).to.have.lengthOf(0) + } + }) + it('Should disable comments and download', async function () { this.timeout(20000) -- cgit v1.2.3