diff options
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts | 41 |
1 files changed, 28 insertions, 13 deletions
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 () { | |||
500 | it('Should view multiple videos on owned servers', async function () { | 500 | it('Should view multiple videos on owned servers', async function () { |
501 | this.timeout(30000) | 501 | this.timeout(30000) |
502 | 502 | ||
503 | const tasks: Promise<any>[] = [] | ||
504 | await viewVideo(servers[2].url, localVideosServer3[0]) | ||
505 | await viewVideo(servers[2].url, localVideosServer3[0]) | ||
506 | await viewVideo(servers[2].url, localVideosServer3[0]) | 503 | await viewVideo(servers[2].url, localVideosServer3[0]) |
507 | await viewVideo(servers[2].url, localVideosServer3[1]) | 504 | await wait(1000) |
508 | |||
509 | await Promise.all(tasks) | ||
510 | await waitJobs(servers) | ||
511 | 505 | ||
512 | await viewVideo(servers[2].url, localVideosServer3[0]) | 506 | await viewVideo(servers[2].url, localVideosServer3[0]) |
507 | await viewVideo(servers[2].url, localVideosServer3[1]) | ||
513 | 508 | ||
514 | await waitJobs(servers) | 509 | await wait(1000) |
515 | 510 | ||
516 | await viewVideo(servers[2].url, localVideosServer3[0]) | 511 | await Promise.all([ |
512 | viewVideo(servers[2].url, localVideosServer3[0]), | ||
513 | viewVideo(servers[2].url, localVideosServer3[0]) | ||
514 | ]) | ||
517 | 515 | ||
518 | await waitJobs(servers) | 516 | await waitJobs(servers) |
519 | 517 | ||
@@ -894,14 +892,14 @@ describe('Test multiple servers', function () { | |||
894 | it('Should delete the thread comments', async function () { | 892 | it('Should delete the thread comments', async function () { |
895 | this.timeout(10000) | 893 | this.timeout(10000) |
896 | 894 | ||
897 | const res1 = await getVideoCommentThreads(servers[0].url, videoUUID, 0, 5) | 895 | const res = await getVideoCommentThreads(servers[ 0 ].url, videoUUID, 0, 5) |
898 | const threadId = res1.body.data.find(c => c.text === 'my super first comment').id | 896 | const threadId = res.body.data.find(c => c.text === 'my super first comment').id |
899 | await deleteVideoComment(servers[0].url, servers[0].accessToken, videoUUID, threadId) | 897 | await deleteVideoComment(servers[ 0 ].url, servers[ 0 ].accessToken, videoUUID, threadId) |
900 | 898 | ||
901 | await waitJobs(servers) | 899 | await waitJobs(servers) |
902 | }) | 900 | }) |
903 | 901 | ||
904 | it('Should have the thread comments deleted on other servers too', async function () { | 902 | it('Should have the threads deleted on other servers too', async function () { |
905 | for (const server of servers) { | 903 | for (const server of servers) { |
906 | const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) | 904 | const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) |
907 | 905 | ||
@@ -922,6 +920,23 @@ describe('Test multiple servers', function () { | |||
922 | } | 920 | } |
923 | }) | 921 | }) |
924 | 922 | ||
923 | it('Should delete a remote thread by the origin server', async function () { | ||
924 | const res = await getVideoCommentThreads(servers[ 0 ].url, videoUUID, 0, 5) | ||
925 | const threadId = res.body.data.find(c => c.text === 'my super second comment').id | ||
926 | await deleteVideoComment(servers[ 0 ].url, servers[ 0 ].accessToken, videoUUID, threadId) | ||
927 | |||
928 | await waitJobs(servers) | ||
929 | }) | ||
930 | |||
931 | it('Should have the threads deleted on other servers too', async function () { | ||
932 | for (const server of servers) { | ||
933 | const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5) | ||
934 | |||
935 | expect(res.body.total).to.equal(0) | ||
936 | expect(res.body.data).to.have.lengthOf(0) | ||
937 | } | ||
938 | }) | ||
939 | |||
925 | it('Should disable comments and download', async function () { | 940 | it('Should disable comments and download', async function () { |
926 | this.timeout(20000) | 941 | this.timeout(20000) |
927 | 942 | ||