aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/abuses.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/abuses.ts')
-rw-r--r--server/tests/api/check-params/abuses.ts13
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'
21import { AbuseCreate, AbuseState } from '@shared/models' 19import { 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 ])