aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/external-plugins/auto-mute.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/external-plugins/auto-mute.ts')
-rw-r--r--server/tests/external-plugins/auto-mute.ts38
1 files changed, 18 insertions, 20 deletions
diff --git a/server/tests/external-plugins/auto-mute.ts b/server/tests/external-plugins/auto-mute.ts
index 844023b83..81a96744e 100644
--- a/server/tests/external-plugins/auto-mute.ts
+++ b/server/tests/external-plugins/auto-mute.ts
@@ -7,14 +7,12 @@ import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow, 8 doubleFollow,
9 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
10 getVideosList,
11 killallServers, 10 killallServers,
12 makeGetRequest, 11 makeGetRequest,
13 MockBlocklist, 12 MockBlocklist,
14 reRunServer, 13 reRunServer,
15 ServerInfo, 14 ServerInfo,
16 setAccessTokensToServers, 15 setAccessTokensToServers,
17 uploadVideoAndGetId,
18 wait 16 wait
19} from '@shared/extra-utils' 17} from '@shared/extra-utils'
20 18
@@ -37,8 +35,8 @@ describe('Official plugin auto-mute', function () {
37 blocklistServer = new MockBlocklist() 35 blocklistServer = new MockBlocklist()
38 port = await blocklistServer.initialize() 36 port = await blocklistServer.initialize()
39 37
40 await uploadVideoAndGetId({ server: servers[0], videoName: 'video server 1' }) 38 await await servers[0].videosCommand.quickUpload({ name: 'video server 1' })
41 await uploadVideoAndGetId({ server: servers[1], videoName: 'video server 2' }) 39 await await servers[1].videosCommand.quickUpload({ name: 'video server 2' })
42 40
43 await doubleFollow(servers[0], servers[1]) 41 await doubleFollow(servers[0], servers[1])
44 }) 42 })
@@ -66,8 +64,8 @@ describe('Official plugin auto-mute', function () {
66 64
67 await wait(2000) 65 await wait(2000)
68 66
69 const res = await getVideosList(servers[0].url) 67 const { total } = await servers[0].videosCommand.list()
70 expect(res.body.total).to.equal(1) 68 expect(total).to.equal(1)
71 }) 69 })
72 70
73 it('Should remove a server blocklist', async function () { 71 it('Should remove a server blocklist', async function () {
@@ -84,8 +82,8 @@ describe('Official plugin auto-mute', function () {
84 82
85 await wait(2000) 83 await wait(2000)
86 84
87 const res = await getVideosList(servers[0].url) 85 const { total } = await servers[0].videosCommand.list()
88 expect(res.body.total).to.equal(2) 86 expect(total).to.equal(2)
89 }) 87 })
90 88
91 it('Should add an account blocklist', async function () { 89 it('Should add an account blocklist', async function () {
@@ -101,8 +99,8 @@ describe('Official plugin auto-mute', function () {
101 99
102 await wait(2000) 100 await wait(2000)
103 101
104 const res = await getVideosList(servers[0].url) 102 const { total } = await servers[0].videosCommand.list()
105 expect(res.body.total).to.equal(1) 103 expect(total).to.equal(1)
106 }) 104 })
107 105
108 it('Should remove an account blocklist', async function () { 106 it('Should remove an account blocklist', async function () {
@@ -119,8 +117,8 @@ describe('Official plugin auto-mute', function () {
119 117
120 await wait(2000) 118 await wait(2000)
121 119
122 const res = await getVideosList(servers[0].url) 120 const { total } = await servers[0].videosCommand.list()
123 expect(res.body.total).to.equal(2) 121 expect(total).to.equal(2)
124 }) 122 })
125 123
126 it('Should auto mute an account, manually unmute it and do not remute it automatically', async function () { 124 it('Should auto mute an account, manually unmute it and do not remute it automatically', async function () {
@@ -140,15 +138,15 @@ describe('Official plugin auto-mute', function () {
140 await wait(2000) 138 await wait(2000)
141 139
142 { 140 {
143 const res = await getVideosList(servers[0].url) 141 const { total } = await servers[0].videosCommand.list()
144 expect(res.body.total).to.equal(1) 142 expect(total).to.equal(1)
145 } 143 }
146 144
147 await servers[0].blocklistCommand.removeFromServerBlocklist({ account }) 145 await servers[0].blocklistCommand.removeFromServerBlocklist({ account })
148 146
149 { 147 {
150 const res = await getVideosList(servers[0].url) 148 const { total } = await servers[0].videosCommand.list()
151 expect(res.body.total).to.equal(2) 149 expect(total).to.equal(2)
152 } 150 }
153 151
154 await killallServers([ servers[0] ]) 152 await killallServers([ servers[0] ])
@@ -156,8 +154,8 @@ describe('Official plugin auto-mute', function () {
156 await wait(2000) 154 await wait(2000)
157 155
158 { 156 {
159 const res = await getVideosList(servers[0].url) 157 const { total } = await servers[0].videosCommand.list()
160 expect(res.body.total).to.equal(2) 158 expect(total).to.equal(2)
161 } 159 }
162 }) 160 })
163 161
@@ -215,8 +213,8 @@ describe('Official plugin auto-mute', function () {
215 await wait(2000) 213 await wait(2000)
216 214
217 for (const server of servers) { 215 for (const server of servers) {
218 const res = await getVideosList(server.url) 216 const { total } = await server.videosCommand.list()
219 expect(res.body.total).to.equal(1) 217 expect(total).to.equal(1)
220 } 218 }
221 }) 219 })
222 220