From 3cabf3532b9118a19311f14ca3e171d12d554a2f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 Nov 2020 13:59:50 +0100 Subject: Add live server hooks --- server/tests/plugins/filter-hooks.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'server/tests/plugins/filter-hooks.ts') diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index 4d354b68e..9939b8e6e 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts @@ -6,6 +6,7 @@ import { ServerConfig } from '@shared/models' import { addVideoCommentReply, addVideoCommentThread, + createLive, doubleFollow, getConfig, getPluginTestPath, @@ -19,6 +20,7 @@ import { registerUser, setAccessTokensToServers, setDefaultVideoChannel, + updateCustomSubConfig, updateVideo, uploadVideo, waitJobs @@ -61,6 +63,17 @@ describe('Test plugin filter hooks', function () { const res = await getVideosList(servers[0].url) videoUUID = res.body.data[0].uuid + + await updateCustomSubConfig(servers[0].url, servers[0].accessToken, { + live: { enabled: true }, + signup: { enabled: true }, + import: { + videos: { + http: { enabled: true }, + torrent: { enabled: true } + } + } + }) }) it('Should run filter:api.videos.list.params', async function () { @@ -87,6 +100,16 @@ describe('Test plugin filter hooks', function () { await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video with bad word' }, 403) }) + it('Should run filter:api.live-video.create.accept.result', async function () { + const attributes = { + name: 'video with bad word', + privacy: VideoPrivacy.PUBLIC, + channelId: servers[0].videoChannel.id + } + + await createLive(servers[0].url, servers[0].accessToken, attributes, 403) + }) + it('Should run filter:api.video.pre-import-url.accept.result', async function () { const baseAttributes = { name: 'normal title', -- cgit v1.2.3