]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/follows.ts
Add ability to configure log level
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / follows.ts
index 27cf94985493d954f8c804a3db13ab28c0cc0f8e..7c4dea458a2302ad5f428bf3195607068465e740 100644 (file)
@@ -27,7 +27,7 @@ describe('Test follows', function () {
   let servers: ServerInfo[] = []
 
   before(async function () {
-    this.timeout(20000)
+    this.timeout(30000)
 
     servers = await flushAndRunMultipleServers(3)
 
@@ -117,7 +117,7 @@ describe('Test follows', function () {
     expect(follows.length).to.equal(0)
   })
 
-  it('Should have the correct following counts', async function () {
+  it('Should have the correct follows counts', async function () {
     await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2)
     await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
     await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0)
@@ -158,7 +158,7 @@ describe('Test follows', function () {
     expect(follows.length).to.equal(0)
   })
 
-  it('Should have the correct following counts 2', async function () {
+  it('Should have the correct follows counts 2', async function () {
     await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 1)
     await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
 
@@ -248,7 +248,7 @@ describe('Test follows', function () {
       await wait(7000)
     })
 
-    it('Should have the correct following counts 2', async function () {
+    it('Should have the correct follows counts 3', async function () {
       await expectAccountFollows(servers[0].url, 'peertube@localhost:9001', 0, 2)
       await expectAccountFollows(servers[0].url, 'peertube@localhost:9002', 1, 0)
       await expectAccountFollows(servers[0].url, 'peertube@localhost:9003', 1, 0)
@@ -256,7 +256,7 @@ describe('Test follows', function () {
       await expectAccountFollows(servers[1].url, 'peertube@localhost:9001', 0, 1)
       await expectAccountFollows(servers[1].url, 'peertube@localhost:9002', 1, 0)
 
-      await expectAccountFollows(servers[2].url, 'peertube@localhost:9001', 0, 1)
+      await expectAccountFollows(servers[2].url, 'peertube@localhost:9001', 0, 2)
       await expectAccountFollows(servers[2].url, 'peertube@localhost:9003', 1, 0)
     })
 
@@ -343,6 +343,18 @@ describe('Test follows', function () {
       expect(secondChild.comment.text).to.equal('my second answer to thread 1')
       expect(secondChild.children).to.have.lengthOf(0)
     })
+
+    it('Should unfollow server 3 on server 1 and does not list server 3 videos', async function () {
+      this.timeout(5000)
+
+      await unfollow(servers[0].url, servers[0].accessToken, servers[2])
+
+      await wait(3000)
+
+      let res = await getVideosList(servers[ 0 ].url)
+      expect(res.body.total).to.equal(1)
+    })
+
   })
 
   after(async function () {