]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/follows-moderation.ts
Fix retrieving of deleted comments when subscribing to a new instance
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / follows-moderation.ts
index fc20f8961d0332134cf3b3f7404f23367674b5b8..1984c9eb14a1d1ae749b541374186a0a09642063 100644 (file)
@@ -24,34 +24,34 @@ const expect = chai.expect
 
 async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'accepted') {
   {
-    const res = await getFollowingListPaginationAndSort(servers[0].url, 0, 5, 'createdAt')
+    const res = await getFollowingListPaginationAndSort({ url: servers[ 0 ].url, start: 0, count: 5, sort: 'createdAt' })
     expect(res.body.total).to.equal(1)
 
     const follow = res.body.data[0] as ActorFollow
     expect(follow.state).to.equal(state)
-    expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + 'accounts/peertube')
+    expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + '/accounts/peertube')
     expect(follow.following.url).to.equal('http://localhost:' + servers[1].port + '/accounts/peertube')
   }
 
   {
-    const res = await getFollowersListPaginationAndSort(servers[1].url, 0, 5, 'createdAt')
+    const res = await getFollowersListPaginationAndSort({ url: servers[ 1 ].url, start: 0, count: 5, sort: 'createdAt' })
     expect(res.body.total).to.equal(1)
 
     const follow = res.body.data[0] as ActorFollow
     expect(follow.state).to.equal(state)
-    expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + 'accounts/peertube')
+    expect(follow.follower.url).to.equal('http://localhost:' + servers[0].port + '/accounts/peertube')
     expect(follow.following.url).to.equal('http://localhost:' + servers[1].port + '/accounts/peertube')
   }
 }
 
 async function checkNoFollowers (servers: ServerInfo[]) {
   {
-    const res = await getFollowingListPaginationAndSort(servers[ 0 ].url, 0, 5, 'createdAt')
+    const res = await getFollowingListPaginationAndSort({ url: servers[ 0 ].url, start: 0, count: 5, sort: 'createdAt' })
     expect(res.body.total).to.equal(0)
   }
 
   {
-    const res = await getFollowersListPaginationAndSort(servers[ 1 ].url, 0, 5, 'createdAt')
+    const res = await getFollowersListPaginationAndSort({ url: servers[ 1 ].url, start: 0, count: 5, sort: 'createdAt' })
     expect(res.body.total).to.equal(0)
   }
 }
@@ -164,17 +164,17 @@ describe('Test follows moderation', function () {
     await waitJobs(servers)
 
     {
-      const res = await getFollowingListPaginationAndSort(servers[0].url, 0, 5, 'createdAt')
+      const res = await getFollowingListPaginationAndSort({ url: servers[ 0 ].url, start: 0, count: 5, sort: 'createdAt' })
       expect(res.body.total).to.equal(2)
     }
 
     {
-      const res = await getFollowersListPaginationAndSort(servers[1].url, 0, 5, 'createdAt')
+      const res = await getFollowersListPaginationAndSort({ url: servers[ 1 ].url, start: 0, count: 5, sort: 'createdAt' })
       expect(res.body.total).to.equal(1)
     }
 
     {
-      const res = await getFollowersListPaginationAndSort(servers[2].url, 0, 5, 'createdAt')
+      const res = await getFollowersListPaginationAndSort({ url: servers[ 2 ].url, start: 0, count: 5, sort: 'createdAt' })
       expect(res.body.total).to.equal(1)
     }
 
@@ -184,7 +184,7 @@ describe('Test follows moderation', function () {
     await checkServer1And2HasFollowers(servers)
 
     {
-      const res = await getFollowersListPaginationAndSort(servers[ 2 ].url, 0, 5, 'createdAt')
+      const res = await getFollowersListPaginationAndSort({ url: servers[ 2 ].url, start: 0, count: 5, sort: 'createdAt' })
       expect(res.body.total).to.equal(0)
     }
   })