]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/follows-moderation.ts
Refactor live manager
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / follows-moderation.ts
index a82acdb34a4c8417e7e1e770337873f27259379a..73c212a32333771236602488d6e02b669786c032 100644 (file)
@@ -1,4 +1,4 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import * as chai from 'chai'
 import 'mocha'
@@ -24,7 +24,7 @@ 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
@@ -34,7 +34,7 @@ async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'acc
   }
 
   {
-    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
@@ -46,12 +46,12 @@ async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'acc
 
 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)
   }
 }
@@ -81,6 +81,8 @@ describe('Test follows moderation', function () {
   })
 
   it('Should remove follower on server 2', async function () {
+    this.timeout(10000)
+
     await removeFollower(servers[1].url, servers[1].accessToken, servers[0])
 
     await waitJobs(servers)
@@ -91,6 +93,8 @@ describe('Test follows moderation', function () {
   })
 
   it('Should disable followers on server 2', async function () {
+    this.timeout(10000)
+
     const subConfig = {
       followers: {
         instance: {
@@ -109,6 +113,8 @@ describe('Test follows moderation', function () {
   })
 
   it('Should re enable followers on server 2', async function () {
+    this.timeout(10000)
+
     const subConfig = {
       followers: {
         instance: {
@@ -151,6 +157,8 @@ describe('Test follows moderation', function () {
   })
 
   it('Should accept a follower', async function () {
+    this.timeout(10000)
+
     await acceptFollower(servers[1].url, servers[1].accessToken, 'peertube@localhost:' + servers[0].port)
     await waitJobs(servers)
 
@@ -164,17 +172,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 +192,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)
     }
   })