+ it('Should reject another follower', async function () {
+ this.timeout(20000)
+
+ await commands[0].follow({ hosts: [ servers[2].url ] })
+ await waitJobs(servers)
+
+ {
+ const body = await commands[0].getFollowings()
+ expect(body.total).to.equal(2)
+ }
+
+ {
+ const body = await commands[1].getFollowers()
+ expect(body.total).to.equal(1)
+ }
+
+ {
+ const body = await commands[2].getFollowers()
+ expect(body.total).to.equal(1)
+ }
+
+ await commands[2].rejectFollower({ follower: 'peertube@' + servers[0].host })
+ await waitJobs(servers)
+
+ { // server 1
+ {
+ const { data } = await commands[0].getFollowings({ state: 'accepted' })
+ expect(data).to.have.lengthOf(1)
+ }
+
+ {
+ const { data } = await commands[0].getFollowings({ state: 'rejected' })
+ expect(data).to.have.lengthOf(1)
+ expectStartWith(data[0].following.url, servers[2].url)
+ }
+ }
+
+ { // server 3
+ {
+ const { data } = await commands[2].getFollowers({ state: 'accepted' })
+ expect(data).to.have.lengthOf(0)
+ }
+
+ {
+ const { data } = await commands[2].getFollowers({ state: 'rejected' })
+ expect(data).to.have.lengthOf(1)
+ expectStartWith(data[0].follower.url, servers[0].url)
+ }
+ }
+ })
+
+ it('Should still auto accept channel followers', async function () {
+ await commands[0].follow({ handles: [ 'root_channel@' + servers[1].host ] })
+
+ await waitJobs(servers)
+
+ const body = await commands[0].getFollowings()
+ const follow = body.data[0]
+ expect(follow.following.name).to.equal('root_channel')
+ expect(follow.state).to.equal('accepted')
+ })