diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-15 10:02:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch) | |
tree | da82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/check-params/abuses.ts | |
parent | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff) | |
download | PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip |
Introduce videos command
Diffstat (limited to 'server/tests/api/check-params/abuses.ts')
-rw-r--r-- | server/tests/api/check-params/abuses.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts index 4cd10a6fd..199cc5599 100644 --- a/server/tests/api/check-params/abuses.ts +++ b/server/tests/api/check-params/abuses.ts | |||
@@ -10,12 +10,10 @@ import { | |||
10 | cleanupTests, | 10 | cleanupTests, |
11 | doubleFollow, | 11 | doubleFollow, |
12 | flushAndRunServer, | 12 | flushAndRunServer, |
13 | getVideoIdFromUUID, | ||
14 | makeGetRequest, | 13 | makeGetRequest, |
15 | makePostBodyRequest, | 14 | makePostBodyRequest, |
16 | ServerInfo, | 15 | ServerInfo, |
17 | setAccessTokensToServers, | 16 | setAccessTokensToServers, |
18 | uploadVideo, | ||
19 | waitJobs | 17 | waitJobs |
20 | } from '@shared/extra-utils' | 18 | } from '@shared/extra-utils' |
21 | import { AbuseCreate, AbuseState } from '@shared/models' | 19 | import { AbuseCreate, AbuseState } from '@shared/models' |
@@ -41,15 +39,10 @@ describe('Test abuses API validators', function () { | |||
41 | 39 | ||
42 | await setAccessTokensToServers([ server ]) | 40 | await setAccessTokensToServers([ server ]) |
43 | 41 | ||
44 | const username = 'user1' | 42 | userToken = await server.usersCommand.generateUserAndToken('user_1') |
45 | const password = 'my super password' | ||
46 | await server.usersCommand.create({ username: username, password: password }) | ||
47 | userToken = await server.loginCommand.getAccessToken({ username, password }) | ||
48 | |||
49 | userToken2 = await server.usersCommand.generateUserAndToken('user_2') | 43 | userToken2 = await server.usersCommand.generateUserAndToken('user_2') |
50 | 44 | ||
51 | const res = await uploadVideo(server.url, server.accessToken, {}) | 45 | server.video = await server.videosCommand.upload() |
52 | server.video = res.body.video | ||
53 | 46 | ||
54 | command = server.abusesCommand | 47 | command = server.abusesCommand |
55 | }) | 48 | }) |
@@ -421,7 +414,7 @@ describe('Test abuses API validators', function () { | |||
421 | 414 | ||
422 | await doubleFollow(anotherServer, server) | 415 | await doubleFollow(anotherServer, server) |
423 | 416 | ||
424 | const server2VideoId = await getVideoIdFromUUID(anotherServer.url, server.video.uuid) | 417 | const server2VideoId = await anotherServer.videosCommand.getId({ uuid: server.video.uuid }) |
425 | await anotherServer.abusesCommand.report({ reason: 'remote server', videoId: server2VideoId }) | 418 | await anotherServer.abusesCommand.report({ reason: 'remote server', videoId: server2VideoId }) |
426 | 419 | ||
427 | await waitJobs([ server, anotherServer ]) | 420 | await waitJobs([ server, anotherServer ]) |