diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-08 11:17:55 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | e3d15a6a9aed97a004d9dac1b7a6499d794e080a (patch) | |
tree | 7637ac85a8659a66a1290c9533e0206e9a0c5a30 /server/tests/external-plugins/auto-block-videos.ts | |
parent | a1637fa1e25b60a88f7cfe50aac8953f50d55761 (diff) | |
download | PeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.tar.gz PeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.tar.zst PeerTube-e3d15a6a9aed97a004d9dac1b7a6499d794e080a.zip |
Introduce blacklist command
Diffstat (limited to 'server/tests/external-plugins/auto-block-videos.ts')
-rw-r--r-- | server/tests/external-plugins/auto-block-videos.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts index 6baf37566..6659b6f39 100644 --- a/server/tests/external-plugins/auto-block-videos.ts +++ b/server/tests/external-plugins/auto-block-videos.ts | |||
@@ -2,13 +2,11 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { Video, VideoBlacklist } from '@shared/models' | 5 | import { Video } from '@shared/models' |
6 | import { | 6 | import { |
7 | doubleFollow, | 7 | doubleFollow, |
8 | getBlacklistedVideosList, | ||
9 | getVideosList, | 8 | getVideosList, |
10 | MockBlocklist, | 9 | MockBlocklist, |
11 | removeVideoFromBlacklist, | ||
12 | setAccessTokensToServers, | 10 | setAccessTokensToServers, |
13 | uploadVideoAndGetId, | 11 | uploadVideoAndGetId, |
14 | wait | 12 | wait |
@@ -97,10 +95,9 @@ describe('Official plugin auto-block videos', function () { | |||
97 | }) | 95 | }) |
98 | 96 | ||
99 | it('Should have video in blacklists', async function () { | 97 | it('Should have video in blacklists', async function () { |
100 | const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken }) | 98 | const body = await servers[0].blacklistCommand.list() |
101 | |||
102 | const videoBlacklists = res.body.data as VideoBlacklist[] | ||
103 | 99 | ||
100 | const videoBlacklists = body.data | ||
104 | expect(videoBlacklists).to.have.lengthOf(1) | 101 | expect(videoBlacklists).to.have.lengthOf(1) |
105 | expect(videoBlacklists[0].reason).to.contains('Automatically blocked from auto block plugin') | 102 | expect(videoBlacklists[0].reason).to.contains('Automatically blocked from auto block plugin') |
106 | expect(videoBlacklists[0].video.name).to.equal(server2Videos[0].name) | 103 | expect(videoBlacklists[0].video.name).to.equal(server2Videos[0].name) |
@@ -163,7 +160,7 @@ describe('Official plugin auto-block videos', function () { | |||
163 | 160 | ||
164 | await check(servers[0], video.uuid, false) | 161 | await check(servers[0], video.uuid, false) |
165 | 162 | ||
166 | await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, video.uuid) | 163 | await servers[0].blacklistCommand.remove({ videoId: video.uuid }) |
167 | 164 | ||
168 | await check(servers[0], video.uuid, true) | 165 | await check(servers[0], video.uuid, true) |
169 | 166 | ||