From e3d15a6a9aed97a004d9dac1b7a6499d794e080a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Jul 2021 11:17:55 +0200 Subject: Introduce blacklist command --- server/tests/external-plugins/auto-block-videos.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'server/tests/external-plugins/auto-block-videos.ts') 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 @@ import 'mocha' import { expect } from 'chai' -import { Video, VideoBlacklist } from '@shared/models' +import { Video } from '@shared/models' import { doubleFollow, - getBlacklistedVideosList, getVideosList, MockBlocklist, - removeVideoFromBlacklist, setAccessTokensToServers, uploadVideoAndGetId, wait @@ -97,10 +95,9 @@ describe('Official plugin auto-block videos', function () { }) it('Should have video in blacklists', async function () { - const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken }) - - const videoBlacklists = res.body.data as VideoBlacklist[] + const body = await servers[0].blacklistCommand.list() + const videoBlacklists = body.data expect(videoBlacklists).to.have.lengthOf(1) expect(videoBlacklists[0].reason).to.contains('Automatically blocked from auto block plugin') expect(videoBlacklists[0].video.name).to.equal(server2Videos[0].name) @@ -163,7 +160,7 @@ describe('Official plugin auto-block videos', function () { await check(servers[0], video.uuid, false) - await removeVideoFromBlacklist(servers[0].url, servers[0].accessToken, video.uuid) + await servers[0].blacklistCommand.remove({ videoId: video.uuid }) await check(servers[0], video.uuid, true) -- cgit v1.2.3