]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/follows-moderation.ts
chore(refactor): remove shared folder dependencies to the server
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / follows-moderation.ts
index 045024544a5de933db82bae437513f311e543188..921f510435cf3131e6bd138b4481c79f24660ce9 100644 (file)
@@ -4,16 +4,16 @@ import 'mocha'
 import * as chai from 'chai'
 import {
   cleanupTests,
-  flushAndRunMultipleServers,
+  createMultipleServers,
   FollowsCommand,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers,
   waitJobs
 } from '@shared/extra-utils'
 
 const expect = chai.expect
 
-async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'accepted') {
+async function checkServer1And2HasFollowers (servers: PeerTubeServer[], state = 'accepted') {
   const fns = [
     servers[0].follows.getFollowings.bind(servers[0].follows),
     servers[1].follows.getFollowers.bind(servers[1].follows)
@@ -30,7 +30,7 @@ async function checkServer1And2HasFollowers (servers: ServerInfo[], state = 'acc
   }
 }
 
-async function checkNoFollowers (servers: ServerInfo[]) {
+async function checkNoFollowers (servers: PeerTubeServer[]) {
   const fns = [
     servers[0].follows.getFollowings.bind(servers[0].follows),
     servers[1].follows.getFollowers.bind(servers[1].follows)
@@ -43,13 +43,13 @@ async function checkNoFollowers (servers: ServerInfo[]) {
 }
 
 describe('Test follows moderation', function () {
-  let servers: ServerInfo[] = []
+  let servers: PeerTubeServer[] = []
   let commands: FollowsCommand[]
 
   before(async function () {
     this.timeout(30000)
 
-    servers = await flushAndRunMultipleServers(3)
+    servers = await createMultipleServers(3)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
@@ -60,7 +60,7 @@ describe('Test follows moderation', function () {
   it('Should have server 1 following server 2', async function () {
     this.timeout(30000)
 
-    await commands[0].follow({ targets: [ servers[1].url ] })
+    await commands[0].follow({ hosts: [ servers[1].url ] })
 
     await waitJobs(servers)
   })
@@ -95,7 +95,7 @@ describe('Test follows moderation', function () {
 
     await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
 
-    await commands[0].follow({ targets: [ servers[1].url ] })
+    await commands[0].follow({ hosts: [ servers[1].url ] })
     await waitJobs(servers)
 
     await checkNoFollowers(servers)
@@ -115,7 +115,7 @@ describe('Test follows moderation', function () {
 
     await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
 
-    await commands[0].follow({ targets: [ servers[1].url ] })
+    await commands[0].follow({ hosts: [ servers[1].url ] })
     await waitJobs(servers)
 
     await checkServer1And2HasFollowers(servers)
@@ -139,7 +139,7 @@ describe('Test follows moderation', function () {
     await servers[1].config.updateCustomSubConfig({ newConfig: subConfig })
     await servers[2].config.updateCustomSubConfig({ newConfig: subConfig })
 
-    await commands[0].follow({ targets: [ servers[1].url ] })
+    await commands[0].follow({ hosts: [ servers[1].url ] })
     await waitJobs(servers)
 
     await checkServer1And2HasFollowers(servers, 'pending')
@@ -157,7 +157,7 @@ describe('Test follows moderation', function () {
   it('Should reject another follower', async function () {
     this.timeout(20000)
 
-    await commands[0].follow({ targets: [ servers[2].url ] })
+    await commands[0].follow({ hosts: [ servers[2].url ] })
     await waitJobs(servers)
 
     {