+ const resVideo = await getVideo(servers[1].url, videos[0].uuid)
+ expect(resVideo.body).not.to.be.undefined
+
+ await completeVideoCheck(servers[1].url, resVideo.body, unlistedCheckAttributes)
+
+ {
+ let resComment = await getVideoCommentThreads(servers[1].url, videos[1].uuid, 0, 5)
+ expect(resComment.body.data).to.be.an('array')
+ expect(resComment.body.data).to.have.lengthOf(1)
+
+ threadIdServer2 = resComment.body.data[0].id
+
+ resComment = await getVideoThreadComments(servers[1].url, videos[1].uuid, threadIdServer2)
+
+ const tree: VideoCommentThreadTree = resComment.body
+ expect(tree.comment.text).equal('thread 1')
+ expect(tree.children).to.have.lengthOf(1)
+
+ const firstChild = tree.children[0]
+ expect(firstChild.comment.text).to.equal('comment 1-1')
+ expect(firstChild.children).to.have.lengthOf(1)
+
+ const childOfFirstChild = firstChild.children[0]
+ expect(childOfFirstChild.comment.text).to.equal('comment 1-2')
+ expect(childOfFirstChild.children).to.have.lengthOf(1)
+
+ const childOfChildFirstChild = childOfFirstChild.children[0]
+ expect(childOfChildFirstChild.comment.text).to.equal('comment 1-3')
+ expect(childOfChildFirstChild.children).to.have.lengthOf(0)
+
+ commentIdServer2 = childOfChildFirstChild.comment.id
+ }
+ })
+
+ it('Should correctly reply to the comment', async function () {
+ this.timeout(15000)
+
+ await addVideoCommentReply(servers[1].url, servers[1].accessToken, videos[1].uuid, commentIdServer2, 'comment 1-4')
+
+ await wait(5000)
+
+ {
+ const resComment = await getVideoThreadComments(servers[0].url, videos[1].uuid, threadIdServer1)
+
+ const tree: VideoCommentThreadTree = resComment.body
+ expect(tree.comment.text).equal('thread 1')
+ expect(tree.children).to.have.lengthOf(1)
+
+ const firstChild = tree.children[0]
+ expect(firstChild.comment.text).to.equal('comment 1-1')
+ expect(firstChild.children).to.have.lengthOf(1)
+
+ const childOfFirstChild = firstChild.children[0]
+ expect(childOfFirstChild.comment.text).to.equal('comment 1-2')
+ expect(childOfFirstChild.children).to.have.lengthOf(1)
+
+ const childOfChildFirstChild = childOfFirstChild.children[0]
+ expect(childOfChildFirstChild.comment.text).to.equal('comment 1-3')
+ expect(childOfChildFirstChild.children).to.have.lengthOf(1)
+
+ const childOfChildOfChildOfFirstChild = childOfChildFirstChild.children[0]
+ expect(childOfChildOfChildOfFirstChild.comment.text).to.equal('comment 1-4')
+ expect(childOfChildOfChildOfFirstChild.children).to.have.lengthOf(0)
+ }