diff options
Diffstat (limited to 'server/tests/external-plugins/auto-mute.ts')
-rw-r--r-- | server/tests/external-plugins/auto-mute.ts | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/external-plugins/auto-mute.ts b/server/tests/external-plugins/auto-mute.ts index 81a96744e..25b56a546 100644 --- a/server/tests/external-plugins/auto-mute.ts +++ b/server/tests/external-plugins/auto-mute.ts | |||
@@ -29,20 +29,20 @@ describe('Official plugin auto-mute', function () { | |||
29 | await setAccessTokensToServers(servers) | 29 | await setAccessTokensToServers(servers) |
30 | 30 | ||
31 | for (const server of servers) { | 31 | for (const server of servers) { |
32 | await server.pluginsCommand.install({ npmName: 'peertube-plugin-auto-mute' }) | 32 | await server.plugins.install({ npmName: 'peertube-plugin-auto-mute' }) |
33 | } | 33 | } |
34 | 34 | ||
35 | blocklistServer = new MockBlocklist() | 35 | blocklistServer = new MockBlocklist() |
36 | port = await blocklistServer.initialize() | 36 | port = await blocklistServer.initialize() |
37 | 37 | ||
38 | await await servers[0].videosCommand.quickUpload({ name: 'video server 1' }) | 38 | await await servers[0].videos.quickUpload({ name: 'video server 1' }) |
39 | await await servers[1].videosCommand.quickUpload({ name: 'video server 2' }) | 39 | await await servers[1].videos.quickUpload({ name: 'video server 2' }) |
40 | 40 | ||
41 | await doubleFollow(servers[0], servers[1]) | 41 | await doubleFollow(servers[0], servers[1]) |
42 | }) | 42 | }) |
43 | 43 | ||
44 | it('Should update plugin settings', async function () { | 44 | it('Should update plugin settings', async function () { |
45 | await servers[0].pluginsCommand.updateSettings({ | 45 | await servers[0].plugins.updateSettings({ |
46 | npmName: 'peertube-plugin-auto-mute', | 46 | npmName: 'peertube-plugin-auto-mute', |
47 | settings: { | 47 | settings: { |
48 | 'blocklist-urls': `http://localhost:${port}/blocklist`, | 48 | 'blocklist-urls': `http://localhost:${port}/blocklist`, |
@@ -64,7 +64,7 @@ describe('Official plugin auto-mute', function () { | |||
64 | 64 | ||
65 | await wait(2000) | 65 | await wait(2000) |
66 | 66 | ||
67 | const { total } = await servers[0].videosCommand.list() | 67 | const { total } = await servers[0].videos.list() |
68 | expect(total).to.equal(1) | 68 | expect(total).to.equal(1) |
69 | }) | 69 | }) |
70 | 70 | ||
@@ -82,7 +82,7 @@ describe('Official plugin auto-mute', function () { | |||
82 | 82 | ||
83 | await wait(2000) | 83 | await wait(2000) |
84 | 84 | ||
85 | const { total } = await servers[0].videosCommand.list() | 85 | const { total } = await servers[0].videos.list() |
86 | expect(total).to.equal(2) | 86 | expect(total).to.equal(2) |
87 | }) | 87 | }) |
88 | 88 | ||
@@ -99,7 +99,7 @@ describe('Official plugin auto-mute', function () { | |||
99 | 99 | ||
100 | await wait(2000) | 100 | await wait(2000) |
101 | 101 | ||
102 | const { total } = await servers[0].videosCommand.list() | 102 | const { total } = await servers[0].videos.list() |
103 | expect(total).to.equal(1) | 103 | expect(total).to.equal(1) |
104 | }) | 104 | }) |
105 | 105 | ||
@@ -117,7 +117,7 @@ describe('Official plugin auto-mute', function () { | |||
117 | 117 | ||
118 | await wait(2000) | 118 | await wait(2000) |
119 | 119 | ||
120 | const { total } = await servers[0].videosCommand.list() | 120 | const { total } = await servers[0].videos.list() |
121 | expect(total).to.equal(2) | 121 | expect(total).to.equal(2) |
122 | }) | 122 | }) |
123 | 123 | ||
@@ -138,14 +138,14 @@ describe('Official plugin auto-mute', function () { | |||
138 | await wait(2000) | 138 | await wait(2000) |
139 | 139 | ||
140 | { | 140 | { |
141 | const { total } = await servers[0].videosCommand.list() | 141 | const { total } = await servers[0].videos.list() |
142 | expect(total).to.equal(1) | 142 | expect(total).to.equal(1) |
143 | } | 143 | } |
144 | 144 | ||
145 | await servers[0].blocklistCommand.removeFromServerBlocklist({ account }) | 145 | await servers[0].blocklist.removeFromServerBlocklist({ account }) |
146 | 146 | ||
147 | { | 147 | { |
148 | const { total } = await servers[0].videosCommand.list() | 148 | const { total } = await servers[0].videos.list() |
149 | expect(total).to.equal(2) | 149 | expect(total).to.equal(2) |
150 | } | 150 | } |
151 | 151 | ||
@@ -154,7 +154,7 @@ describe('Official plugin auto-mute', function () { | |||
154 | await wait(2000) | 154 | await wait(2000) |
155 | 155 | ||
156 | { | 156 | { |
157 | const { total } = await servers[0].videosCommand.list() | 157 | const { total } = await servers[0].videos.list() |
158 | expect(total).to.equal(2) | 158 | expect(total).to.equal(2) |
159 | } | 159 | } |
160 | }) | 160 | }) |
@@ -168,7 +168,7 @@ describe('Official plugin auto-mute', function () { | |||
168 | }) | 168 | }) |
169 | 169 | ||
170 | it('Should enable auto mute list', async function () { | 170 | it('Should enable auto mute list', async function () { |
171 | await servers[0].pluginsCommand.updateSettings({ | 171 | await servers[0].plugins.updateSettings({ |
172 | npmName: 'peertube-plugin-auto-mute', | 172 | npmName: 'peertube-plugin-auto-mute', |
173 | settings: { | 173 | settings: { |
174 | 'blocklist-urls': '', | 174 | 'blocklist-urls': '', |
@@ -187,7 +187,7 @@ describe('Official plugin auto-mute', function () { | |||
187 | it('Should mute an account on server 1, and server 2 auto mutes it', async function () { | 187 | it('Should mute an account on server 1, and server 2 auto mutes it', async function () { |
188 | this.timeout(20000) | 188 | this.timeout(20000) |
189 | 189 | ||
190 | await servers[1].pluginsCommand.updateSettings({ | 190 | await servers[1].plugins.updateSettings({ |
191 | npmName: 'peertube-plugin-auto-mute', | 191 | npmName: 'peertube-plugin-auto-mute', |
192 | settings: { | 192 | settings: { |
193 | 'blocklist-urls': 'http://localhost:' + servers[0].port + autoMuteListPath, | 193 | 'blocklist-urls': 'http://localhost:' + servers[0].port + autoMuteListPath, |
@@ -196,8 +196,8 @@ describe('Official plugin auto-mute', function () { | |||
196 | } | 196 | } |
197 | }) | 197 | }) |
198 | 198 | ||
199 | await servers[0].blocklistCommand.addToServerBlocklist({ account: 'root@localhost:' + servers[1].port }) | 199 | await servers[0].blocklist.addToServerBlocklist({ account: 'root@localhost:' + servers[1].port }) |
200 | await servers[0].blocklistCommand.addToMyBlocklist({ server: 'localhost:' + servers[1].port }) | 200 | await servers[0].blocklist.addToMyBlocklist({ server: 'localhost:' + servers[1].port }) |
201 | 201 | ||
202 | const res = await makeGetRequest({ | 202 | const res = await makeGetRequest({ |
203 | url: servers[0].url, | 203 | url: servers[0].url, |
@@ -213,7 +213,7 @@ describe('Official plugin auto-mute', function () { | |||
213 | await wait(2000) | 213 | await wait(2000) |
214 | 214 | ||
215 | for (const server of servers) { | 215 | for (const server of servers) { |
216 | const { total } = await server.videosCommand.list() | 216 | const { total } = await server.videos.list() |
217 | expect(total).to.equal(1) | 217 | expect(total).to.equal(1) |
218 | } | 218 | } |
219 | }) | 219 | }) |