aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/moderation-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 11:17:55 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commite3d15a6a9aed97a004d9dac1b7a6499d794e080a (patch)
tree7637ac85a8659a66a1290c9533e0206e9a0c5a30 /server/tests/api/notifications/moderation-notifications.ts
parenta1637fa1e25b60a88f7cfe50aac8953f50d55761 (diff)
downloadPeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.tar.gz
PeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.tar.zst
PeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.zip
Introduce blacklist command
Diffstat (limited to 'server/tests/api/notifications/moderation-notifications.ts')
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 605b41947..52ade0548 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import { buildUUID } from '@server/helpers/uuid' 4import { buildUUID } from '@server/helpers/uuid'
5import { 5import {
6 addVideoCommentThread, 6 addVideoCommentThread,
7 addVideoToBlacklist,
8 checkAbuseStateChange, 7 checkAbuseStateChange,
9 checkAutoInstanceFollowing, 8 checkAutoInstanceFollowing,
10 CheckerBaseParams, 9 CheckerBaseParams,
@@ -28,7 +27,6 @@ import {
28 MockSmtpServer, 27 MockSmtpServer,
29 prepareNotificationsTest, 28 prepareNotificationsTest,
30 registerUser, 29 registerUser,
31 removeVideoFromBlacklist,
32 ServerInfo, 30 ServerInfo,
33 uploadVideo, 31 uploadVideo,
34 wait, 32 wait,
@@ -297,7 +295,7 @@ describe('Test moderation notifications', function () {
297 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name }) 295 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name })
298 const uuid = resVideo.body.video.uuid 296 const uuid = resVideo.body.video.uuid
299 297
300 await addVideoToBlacklist(servers[0].url, servers[0].accessToken, uuid) 298 await servers[0].blacklistCommand.add({ videoId: uuid })
301 299
302 await waitJobs(servers) 300 await waitJobs(servers)
303 await checkNewBlacklistOnMyVideo(baseParams, uuid, name, 'blacklist') 301 await checkNewBlacklistOnMyVideo(baseParams, uuid, name, 'blacklist')
@@ -310,10 +308,10 @@ describe('Test moderation notifications', function () {
310 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name }) 308 const resVideo = await uploadVideo(servers[0].url, userAccessToken, { name })
311 const uuid = resVideo.body.video.uuid 309 const uuid = resVideo.body.video.uuid
312 310
313 await addVideoToBlacklist(servers[0].url, servers[0].accessToken, uuid) 311 await servers[0].blacklistCommand.add({ videoId: uuid })
314 312
315 await waitJobs(servers) 313 await waitJobs(servers)
316 await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, uuid) 314 await servers[0].blacklistCommand.remove({ videoId: uuid })
317 await waitJobs(servers) 315 await waitJobs(servers)
318 316
319 await wait(500) 317 await wait(500)
@@ -517,7 +515,7 @@ describe('Test moderation notifications', function () {
517 it('Should send video published and unblacklist after video unblacklisted', async function () { 515 it('Should send video published and unblacklist after video unblacklisted', async function () {
518 this.timeout(40000) 516 this.timeout(40000)
519 517
520 await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, videoUUID) 518 await servers[0].blacklistCommand.remove({ videoId: videoUUID })
521 519
522 await waitJobs(servers) 520 await waitJobs(servers)
523 521
@@ -554,7 +552,7 @@ describe('Test moderation notifications', function () {
554 const resVideo = await uploadVideo(servers[0].url, userAccessToken, data) 552 const resVideo = await uploadVideo(servers[0].url, userAccessToken, data)
555 const uuid = resVideo.body.video.uuid 553 const uuid = resVideo.body.video.uuid
556 554
557 await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, uuid) 555 await servers[0].blacklistCommand.remove({ videoId: uuid })
558 556
559 await waitJobs(servers) 557 await waitJobs(servers)
560 await checkNewBlacklistOnMyVideo(userBaseParams, uuid, name, 'unblacklist') 558 await checkNewBlacklistOnMyVideo(userBaseParams, uuid, name, 'unblacklist')