+
+ {
+ const deletedComment = body.data[1]
+ expect(deletedComment).to.not.be.undefined
+ expect(deletedComment.isDeleted).to.be.true
+ expect(deletedComment.deletedAt).to.not.be.null
+ expect(deletedComment.text).to.equal('')
+ expect(deletedComment.inReplyToCommentId).to.be.null
+ expect(deletedComment.account).to.be.null
+ expect(deletedComment.totalReplies).to.equal(2)
+ expect(dateIsValid(deletedComment.createdAt as string)).to.be.true
+ expect(dateIsValid(deletedComment.updatedAt as string)).to.be.true
+ expect(dateIsValid(deletedComment.deletedAt as string)).to.be.true
+ }
+ }
+ })
+
+ it('Should delete a remote thread by the origin server', async function () {
+ this.timeout(5000)
+
+ const { data } = await servers[0].comments.listThreads({ videoId: videoUUID })
+ const commentId = data.find(c => c.text === 'my super second comment').id
+ await servers[0].comments.delete({ videoId: videoUUID, commentId })
+
+ await waitJobs(servers)
+ })
+
+ it('Should have the threads marked as deleted on other servers too', async function () {
+ for (const server of servers) {
+ const body = await server.comments.listThreads({ videoId: videoUUID })
+
+ expect(body.total).to.equal(2)
+ expect(body.data).to.have.lengthOf(2)
+
+ {
+ const comment = body.data[0]
+ expect(comment.text).to.equal('')
+ expect(comment.isDeleted).to.be.true
+ expect(comment.createdAt).to.not.be.null
+ expect(comment.deletedAt).to.not.be.null
+ expect(comment.account).to.be.null
+ expect(comment.totalReplies).to.equal(0)
+ }
+
+ {
+ const comment = body.data[1]
+ expect(comment.text).to.equal('')
+ expect(comment.isDeleted).to.be.true
+ expect(comment.createdAt).to.not.be.null
+ expect(comment.deletedAt).to.not.be.null
+ expect(comment.account).to.be.null
+ expect(comment.totalReplies).to.equal(2)
+ }