+ const res = await getVideoThreadComments(server.url, videoUUID, threadId)
+
+ const tree: VideoCommentThreadTree = res.body
+ expect(tree.comment.text).equal('my super first comment')
+ expect(tree.children).to.have.lengthOf(1)
+
+ const firstChild = tree.children[0]
+ expect(firstChild.comment.text).to.equal('my super answer to thread 1')
+ expect(firstChild.children).to.have.lengthOf(1)
+
+ const childOfFirstChild = firstChild.children[0]
+ expect(childOfFirstChild.comment.text).to.equal('my super answer to answer of thread 1')
+ expect(childOfFirstChild.children).to.have.lengthOf(0)
+ })
+
+ it('Should delete a complete thread', async function () {
+ await deleteVideoComment(server.url, server.accessToken, videoId, threadId)
+
+ const res = await getVideoCommentThreads(server.url, videoUUID, 0, 5, 'createdAt')
+ expect(res.body.total).to.equal(2)
+ expect(res.body.data).to.be.an('array')
+ expect(res.body.data).to.have.lengthOf(2)
+
+ expect(res.body.data[0].text).to.equal('super thread 2')
+ expect(res.body.data[0].totalReplies).to.equal(0)
+ expect(res.body.data[1].text).to.equal('super thread 3')
+ expect(res.body.data[1].totalReplies).to.equal(0)
+ })
+
+ after(function () {
+ killallServers([ server ])