]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/users/user-subscriptions.ts
Add ability for instances to follow any actor
[github/Chocobozzz/PeerTube.git] / server / tests / api / users / user-subscriptions.ts
index 1b15a98dcfec8deccbff055d3d416b038f3de2a2..77b99886d24208a976d63f782ae25c2edd564ea6 100644 (file)
@@ -4,9 +4,9 @@ import 'mocha'
 import * as chai from 'chai'
 import {
   cleanupTests,
+  createMultipleServers,
   doubleFollow,
-  flushAndRunMultipleServers,
-  ServerInfo,
+  PeerTubeServer,
   setAccessTokensToServers,
   SubscriptionsCommand,
   waitJobs
@@ -15,7 +15,7 @@ import {
 const expect = chai.expect
 
 describe('Test users subscriptions', function () {
-  let servers: ServerInfo[] = []
+  let servers: PeerTubeServer[] = []
   const users: { accessToken: string }[] = []
   let video3UUID: string
 
@@ -24,7 +24,7 @@ describe('Test users subscriptions', function () {
   before(async function () {
     this.timeout(120000)
 
-    servers = await flushAndRunMultipleServers(3)
+    servers = await createMultipleServers(3)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
@@ -67,7 +67,8 @@ describe('Test users subscriptions', function () {
 
     await waitJobs(servers)
 
-    const { uuid } = await servers[2].videos.upload({ attributes: { name: 'video server 3 added after follow' } })
+    const attributes = { name: 'video server 3 added after follow' }
+    const { uuid } = await servers[2].videos.upload({ token: users[2].accessToken, attributes })
     video3UUID = uuid
 
     await waitJobs(servers)
@@ -223,7 +224,7 @@ describe('Test users subscriptions', function () {
   it('Should have server 1 follow server 3 and display server 3 videos', async function () {
     this.timeout(60000)
 
-    await servers[0].follows.follow({ targets: [ servers[2].url ] })
+    await servers[0].follows.follow({ hosts: [ servers[2].url ] })
 
     await waitJobs(servers)