diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 16:02:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c (patch) | |
tree | 02d056121540652b0867fc2ef56699138afe6271 /server/tests/api/moderation/abuses.ts | |
parent | 9fff08cf83f34339df7ed4ac770e1dee536adf9d (diff) | |
download | PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.gz PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.zst PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.zip |
Introduce blocklist command
Diffstat (limited to 'server/tests/api/moderation/abuses.ts')
-rw-r--r-- | server/tests/api/moderation/abuses.ts | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.ts index 124833cf6..a2bd07b12 100644 --- a/server/tests/api/moderation/abuses.ts +++ b/server/tests/api/moderation/abuses.ts | |||
@@ -4,8 +4,6 @@ import 'mocha' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { | 5 | import { |
6 | AbusesCommand, | 6 | AbusesCommand, |
7 | addAccountToServerBlocklist, | ||
8 | addServerToServerBlocklist, | ||
9 | addVideoCommentThread, | 7 | addVideoCommentThread, |
10 | cleanupTests, | 8 | cleanupTests, |
11 | createUser, | 9 | createUser, |
@@ -16,8 +14,6 @@ import { | |||
16 | getVideoCommentThreads, | 14 | getVideoCommentThreads, |
17 | getVideoIdFromUUID, | 15 | getVideoIdFromUUID, |
18 | getVideosList, | 16 | getVideosList, |
19 | removeAccountFromServerBlocklist, | ||
20 | removeServerFromServerBlocklist, | ||
21 | removeUser, | 17 | removeUser, |
22 | removeVideo, | 18 | removeVideo, |
23 | ServerInfo, | 19 | ServerInfo, |
@@ -27,7 +23,7 @@ import { | |||
27 | userLogin, | 23 | userLogin, |
28 | waitJobs | 24 | waitJobs |
29 | } from '@shared/extra-utils' | 25 | } from '@shared/extra-utils' |
30 | import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, Account, AdminAbuse, UserAbuse, VideoComment } from '@shared/models' | 26 | import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse, VideoComment } from '@shared/models' |
31 | 27 | ||
32 | const expect = chai.expect | 28 | const expect = chai.expect |
33 | 29 | ||
@@ -225,7 +221,7 @@ describe('Test abuses', function () { | |||
225 | const accountToBlock = 'root@' + servers[1].host | 221 | const accountToBlock = 'root@' + servers[1].host |
226 | 222 | ||
227 | { | 223 | { |
228 | await addAccountToServerBlocklist(servers[0].url, servers[0].accessToken, accountToBlock) | 224 | await servers[0].blocklistCommand.addToServerBlocklist({ account: accountToBlock }) |
229 | 225 | ||
230 | const body = await commands[0].getAdminList() | 226 | const body = await commands[0].getAdminList() |
231 | expect(body.total).to.equal(2) | 227 | expect(body.total).to.equal(2) |
@@ -235,7 +231,7 @@ describe('Test abuses', function () { | |||
235 | } | 231 | } |
236 | 232 | ||
237 | { | 233 | { |
238 | await removeAccountFromServerBlocklist(servers[0].url, servers[0].accessToken, accountToBlock) | 234 | await servers[0].blocklistCommand.removeFromServerBlocklist({ account: accountToBlock }) |
239 | 235 | ||
240 | const body = await commands[0].getAdminList() | 236 | const body = await commands[0].getAdminList() |
241 | expect(body.total).to.equal(3) | 237 | expect(body.total).to.equal(3) |
@@ -246,7 +242,7 @@ describe('Test abuses', function () { | |||
246 | const serverToBlock = servers[1].host | 242 | const serverToBlock = servers[1].host |
247 | 243 | ||
248 | { | 244 | { |
249 | await addServerToServerBlocklist(servers[0].url, servers[0].accessToken, servers[1].host) | 245 | await servers[0].blocklistCommand.addToServerBlocklist({ server: serverToBlock }) |
250 | 246 | ||
251 | const body = await commands[0].getAdminList() | 247 | const body = await commands[0].getAdminList() |
252 | expect(body.total).to.equal(2) | 248 | expect(body.total).to.equal(2) |
@@ -256,7 +252,7 @@ describe('Test abuses', function () { | |||
256 | } | 252 | } |
257 | 253 | ||
258 | { | 254 | { |
259 | await removeServerFromServerBlocklist(servers[0].url, servers[0].accessToken, serverToBlock) | 255 | await servers[0].blocklistCommand.removeFromServerBlocklist({ server: serverToBlock }) |
260 | 256 | ||
261 | const body = await commands[0].getAdminList() | 257 | const body = await commands[0].getAdminList() |
262 | expect(body.total).to.equal(3) | 258 | expect(body.total).to.equal(3) |