aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/multiple-servers.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-04 11:48:12 +0100
committerChocobozzz <me@florianbigard.com>2019-12-04 11:48:12 +0100
commitc883db6d038a8510205f5f13ef46fb5a1c9e8288 (patch)
treed8becd3b5cf3bddf14559f062d7ca4f96d1b25c3 /server/tests/api/videos/multiple-servers.ts
parentb5206dfc455c119b0dcb897bd7144be6ea4d999d (diff)
downloadPeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.tar.gz
PeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.tar.zst
PeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.zip
Move deleted comment on new follow tests
Diffstat (limited to 'server/tests/api/videos/multiple-servers.ts')
-rw-r--r--server/tests/api/videos/multiple-servers.ts46
1 files changed, 4 insertions, 42 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 836bdc658..22d87b88c 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -517,6 +517,8 @@ describe('Test multiple servers', function () {
517 // Wait the repeatable job 517 // Wait the repeatable job
518 await wait(6000) 518 await wait(6000)
519 519
520 await waitJobs(servers)
521
520 for (const server of servers) { 522 for (const server of servers) {
521 const res = await getVideosList(server.url) 523 const res = await getVideosList(server.url)
522 524
@@ -551,6 +553,8 @@ describe('Test multiple servers', function () {
551 // Wait the repeatable job 553 // Wait the repeatable job
552 await wait(16000) 554 await wait(16000)
553 555
556 await waitJobs(servers)
557
554 let baseVideos = null 558 let baseVideos = null
555 559
556 for (const server of servers) { 560 for (const server of servers) {
@@ -939,48 +943,6 @@ describe('Test multiple servers', function () {
939 } 943 }
940 }) 944 })
941 945
942 it('Should retrieve all comments when subscribing to a new server', async function () {
943 this.timeout(120000)
944
945 const newServer = await flushAndRunServer(4)
946
947 await setAccessTokensToServers([newServer])
948 await doubleFollow(newServer, servers[0])
949 await doubleFollow(newServer, servers[2])
950 await waitJobs([newServer, ...servers])
951
952 const res = await getVideoCommentThreads(newServer.url, videoUUID, 0, 5)
953
954 expect(res.body.total).to.equal(2)
955 expect(res.body.data).to.be.an('array')
956 expect(res.body.data).to.have.lengthOf(2)
957
958 {
959 const comment: VideoComment = res.body.data[0]
960 expect(comment).to.not.be.undefined
961 expect(comment.inReplyToCommentId).to.be.null
962 expect(comment.account.name).to.equal('root')
963 expect(comment.account.host).to.equal('localhost:' + servers[2].port)
964 expect(comment.totalReplies).to.equal(0)
965 expect(dateIsValid(comment.createdAt as string)).to.be.true
966 expect(dateIsValid(comment.updatedAt as string)).to.be.true
967 }
968
969 {
970 const deletedComment: VideoComment = res.body.data[1]
971 expect(deletedComment).to.not.be.undefined
972 expect(deletedComment.isDeleted).to.be.true
973 expect(deletedComment.deletedAt).to.not.be.null
974 expect(deletedComment.text).to.equal('')
975 expect(deletedComment.inReplyToCommentId).to.be.null
976 expect(deletedComment.account).to.be.null
977 expect(deletedComment.totalReplies).to.equal(3)
978 expect(dateIsValid(deletedComment.createdAt as string)).to.be.true
979 expect(dateIsValid(deletedComment.updatedAt as string)).to.be.true
980 expect(dateIsValid(deletedComment.deletedAt as string)).to.be.true
981 }
982 })
983
984 it('Should delete a remote thread by the origin server', async function () { 946 it('Should delete a remote thread by the origin server', async function () {
985 this.timeout(5000) 947 this.timeout(5000)
986 948