diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-22 14:28:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 83903cb65d531a6b6b91715387493ba8312b264d (patch) | |
tree | fd172e26a483331e74f15a062743a9d40d4016d3 /server/tests/api/users/users-multiple-servers.ts | |
parent | c4fa01f7c45b66b112ebd08abce744b7c4041feb (diff) | |
download | PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.gz PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.zst PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.zip |
Generate random uuid for video files
Diffstat (limited to 'server/tests/api/users/users-multiple-servers.ts')
-rw-r--r-- | server/tests/api/users/users-multiple-servers.ts | 20 |
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' |
17 | import { User } from '@shared/models' | 18 | import { MyUser } from '@shared/models' |
18 | 19 | ||
19 | const expect = chai.expect | 20 | const expect = chai.expect |
20 | 21 | ||
21 | describe('Test users with multiple servers', function () { | 22 | describe('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 | ||