diff options
Diffstat (limited to 'server/tests/external-plugins/auto-block-videos.ts')
-rw-r--r-- | server/tests/external-plugins/auto-block-videos.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts index 1cce15a2f..3b4b48bf0 100644 --- a/server/tests/external-plugins/auto-block-videos.ts +++ b/server/tests/external-plugins/auto-block-videos.ts | |||
@@ -16,7 +16,7 @@ import { | |||
16 | import { Video } from '@shared/models' | 16 | import { Video } from '@shared/models' |
17 | 17 | ||
18 | async function check (server: ServerInfo, videoUUID: string, exists = true) { | 18 | async function check (server: ServerInfo, videoUUID: string, exists = true) { |
19 | const { data } = await server.videosCommand.list() | 19 | const { data } = await server.videos.list() |
20 | 20 | ||
21 | const video = data.find(v => v.uuid === videoUUID) | 21 | const video = data.find(v => v.uuid === videoUUID) |
22 | 22 | ||
@@ -38,24 +38,24 @@ describe('Official plugin auto-block videos', function () { | |||
38 | await setAccessTokensToServers(servers) | 38 | await setAccessTokensToServers(servers) |
39 | 39 | ||
40 | for (const server of servers) { | 40 | for (const server of servers) { |
41 | await server.pluginsCommand.install({ npmName: 'peertube-plugin-auto-block-videos' }) | 41 | await server.plugins.install({ npmName: 'peertube-plugin-auto-block-videos' }) |
42 | } | 42 | } |
43 | 43 | ||
44 | blocklistServer = new MockBlocklist() | 44 | blocklistServer = new MockBlocklist() |
45 | port = await blocklistServer.initialize() | 45 | port = await blocklistServer.initialize() |
46 | 46 | ||
47 | await await servers[0].videosCommand.quickUpload({ name: 'video server 1' }) | 47 | await await servers[0].videos.quickUpload({ name: 'video server 1' }) |
48 | await await servers[1].videosCommand.quickUpload({ name: 'video server 2' }) | 48 | await await servers[1].videos.quickUpload({ name: 'video server 2' }) |
49 | await await servers[1].videosCommand.quickUpload({ name: 'video 2 server 2' }) | 49 | await await servers[1].videos.quickUpload({ name: 'video 2 server 2' }) |
50 | await await servers[1].videosCommand.quickUpload({ name: 'video 3 server 2' }) | 50 | await await servers[1].videos.quickUpload({ name: 'video 3 server 2' }) |
51 | 51 | ||
52 | { | 52 | { |
53 | const { data } = await servers[0].videosCommand.list() | 53 | const { data } = await servers[0].videos.list() |
54 | server1Videos = data.map(v => Object.assign(v, { url: servers[0].url + '/videos/watch/' + v.uuid })) | 54 | server1Videos = data.map(v => Object.assign(v, { url: servers[0].url + '/videos/watch/' + v.uuid })) |
55 | } | 55 | } |
56 | 56 | ||
57 | { | 57 | { |
58 | const { data } = await servers[1].videosCommand.list() | 58 | const { data } = await servers[1].videos.list() |
59 | server2Videos = data.map(v => Object.assign(v, { url: servers[1].url + '/videos/watch/' + v.uuid })) | 59 | server2Videos = data.map(v => Object.assign(v, { url: servers[1].url + '/videos/watch/' + v.uuid })) |
60 | } | 60 | } |
61 | 61 | ||
@@ -63,7 +63,7 @@ describe('Official plugin auto-block videos', function () { | |||
63 | }) | 63 | }) |
64 | 64 | ||
65 | it('Should update plugin settings', async function () { | 65 | it('Should update plugin settings', async function () { |
66 | await servers[0].pluginsCommand.updateSettings({ | 66 | await servers[0].plugins.updateSettings({ |
67 | npmName: 'peertube-plugin-auto-block-videos', | 67 | npmName: 'peertube-plugin-auto-block-videos', |
68 | settings: { | 68 | settings: { |
69 | 'blocklist-urls': `http://localhost:${port}/blocklist`, | 69 | 'blocklist-urls': `http://localhost:${port}/blocklist`, |
@@ -91,7 +91,7 @@ describe('Official plugin auto-block videos', function () { | |||
91 | }) | 91 | }) |
92 | 92 | ||
93 | it('Should have video in blacklists', async function () { | 93 | it('Should have video in blacklists', async function () { |
94 | const body = await servers[0].blacklistCommand.list() | 94 | const body = await servers[0].blacklist.list() |
95 | 95 | ||
96 | const videoBlacklists = body.data | 96 | const videoBlacklists = body.data |
97 | expect(videoBlacklists).to.have.lengthOf(1) | 97 | expect(videoBlacklists).to.have.lengthOf(1) |
@@ -156,7 +156,7 @@ describe('Official plugin auto-block videos', function () { | |||
156 | 156 | ||
157 | await check(servers[0], video.uuid, false) | 157 | await check(servers[0], video.uuid, false) |
158 | 158 | ||
159 | await servers[0].blacklistCommand.remove({ videoId: video.uuid }) | 159 | await servers[0].blacklist.remove({ videoId: video.uuid }) |
160 | 160 | ||
161 | await check(servers[0], video.uuid, true) | 161 | await check(servers[0], video.uuid, true) |
162 | 162 | ||