aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/users')
-rw-r--r--server/tests/api/users/users-multiple-servers.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts
index 225145957..16372b039 100644
--- a/server/tests/api/users/users-multiple-servers.ts
+++ b/server/tests/api/users/users-multiple-servers.ts
@@ -10,18 +10,21 @@ import {
10 createMultipleServers, 10 createMultipleServers,
11 doubleFollow, 11 doubleFollow,
12 PeerTubeServer, 12 PeerTubeServer,
13 saveVideoInServers,
13 setAccessTokensToServers, 14 setAccessTokensToServers,
14 testImage, 15 testImage,
15 waitJobs 16 waitJobs
16} from '@shared/extra-utils' 17} from '@shared/extra-utils'
17import { User } from '@shared/models' 18import { MyUser } from '@shared/models'
18 19
19const expect = chai.expect 20const expect = chai.expect
20 21
21describe('Test users with multiple servers', function () { 22describe('Test users with multiple servers', function () {
22 let servers: PeerTubeServer[] = [] 23 let servers: PeerTubeServer[] = []
23 let user: User 24
25 let user: MyUser
24 let userId: number 26 let userId: number
27
25 let videoUUID: string 28 let videoUUID: string
26 let userAccessToken: string 29 let userAccessToken: string
27 let userAvatarFilename: string 30 let userAvatarFilename: string
@@ -45,18 +48,17 @@ describe('Test users with multiple servers', function () {
45 await servers[0].videos.upload() 48 await servers[0].videos.upload()
46 49
47 { 50 {
48 const user = { 51 const username = 'user1'
49 username: 'user1', 52 const created = await servers[0].users.create({ username })
50 password: 'password'
51 }
52 const created = await servers[0].users.create(user)
53 userId = created.id 53 userId = created.id
54 userAccessToken = await servers[0].login.getAccessToken(user) 54 userAccessToken = await servers[0].login.getAccessToken(username)
55 } 55 }
56 56
57 { 57 {
58 const { uuid } = await servers[0].videos.upload({ token: userAccessToken }) 58 const { uuid } = await servers[0].videos.upload({ token: userAccessToken })
59 videoUUID = uuid 59 videoUUID = uuid
60
61 await saveVideoInServers(servers, videoUUID)
60 } 62 }
61 63
62 await waitJobs(servers) 64 await waitJobs(servers)
@@ -195,7 +197,7 @@ describe('Test users with multiple servers', function () {
195 197
196 it('Should not have video files', async () => { 198 it('Should not have video files', async () => {
197 for (const server of servers) { 199 for (const server of servers) {
198 await checkVideoFilesWereRemoved(videoUUID, server) 200 await checkVideoFilesWereRemoved({ server, video: server.store.videoDetails })
199 } 201 }
200 }) 202 })
201 203