aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/external-plugins/auto-block-videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/external-plugins/auto-block-videos.ts')
-rw-r--r--server/tests/external-plugins/auto-block-videos.ts19
1 files changed, 4 insertions, 15 deletions
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts
index 18ea17d78..6baf37566 100644
--- a/server/tests/external-plugins/auto-block-videos.ts
+++ b/server/tests/external-plugins/auto-block-videos.ts
@@ -7,11 +7,9 @@ import {
7 doubleFollow, 7 doubleFollow,
8 getBlacklistedVideosList, 8 getBlacklistedVideosList,
9 getVideosList, 9 getVideosList,
10 installPlugin,
11 MockBlocklist, 10 MockBlocklist,
12 removeVideoFromBlacklist, 11 removeVideoFromBlacklist,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 updatePluginSettings,
15 uploadVideoAndGetId, 13 uploadVideoAndGetId,
16 wait 14 wait
17} from '../../../shared/extra-utils' 15} from '../../../shared/extra-utils'
@@ -28,11 +26,8 @@ async function check (server: ServerInfo, videoUUID: string, exists = true) {
28 26
29 const video = res.body.data.find(v => v.uuid === videoUUID) 27 const video = res.body.data.find(v => v.uuid === videoUUID)
30 28
31 if (exists) { 29 if (exists) expect(video).to.not.be.undefined
32 expect(video).to.not.be.undefined 30 else expect(video).to.be.undefined
33 } else {
34 expect(video).to.be.undefined
35 }
36} 31}
37 32
38describe('Official plugin auto-block videos', function () { 33describe('Official plugin auto-block videos', function () {
@@ -49,11 +44,7 @@ describe('Official plugin auto-block videos', function () {
49 await setAccessTokensToServers(servers) 44 await setAccessTokensToServers(servers)
50 45
51 for (const server of servers) { 46 for (const server of servers) {
52 await installPlugin({ 47 await server.pluginsCommand.install({ npmName: 'peertube-plugin-auto-block-videos' })
53 url: server.url,
54 accessToken: server.accessToken,
55 npmName: 'peertube-plugin-auto-block-videos'
56 })
57 } 48 }
58 49
59 blocklistServer = new MockBlocklist() 50 blocklistServer = new MockBlocklist()
@@ -78,9 +69,7 @@ describe('Official plugin auto-block videos', function () {
78 }) 69 })
79 70
80 it('Should update plugin settings', async function () { 71 it('Should update plugin settings', async function () {
81 await updatePluginSettings({ 72 await servers[0].pluginsCommand.updateSettings({
82 url: servers[0].url,
83 accessToken: servers[0].accessToken,
84 npmName: 'peertube-plugin-auto-block-videos', 73 npmName: 'peertube-plugin-auto-block-videos',
85 settings: { 74 settings: {
86 'blocklist-urls': `http://localhost:${port}/blocklist`, 75 'blocklist-urls': `http://localhost:${port}/blocklist`,