diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/follows.ts | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/server/tests/api/follows.ts b/server/tests/api/follows.ts index b2f53d3a7..875d814a7 100644 --- a/server/tests/api/follows.ts +++ b/server/tests/api/follows.ts | |||
@@ -22,7 +22,7 @@ describe('Test follows', function () { | |||
22 | let server3Id: number | 22 | let server3Id: number |
23 | 23 | ||
24 | before(async function () { | 24 | before(async function () { |
25 | this.timeout(120000) | 25 | this.timeout(20000) |
26 | 26 | ||
27 | servers = await flushAndRunMultipleServers(3) | 27 | servers = await flushAndRunMultipleServers(3) |
28 | 28 | ||
@@ -163,6 +163,34 @@ describe('Test follows', function () { | |||
163 | expect(res.body.data[0].name).to.equal('server3') | 163 | expect(res.body.data[0].name).to.equal('server3') |
164 | }) | 164 | }) |
165 | 165 | ||
166 | it('Should propagate previous uploaded videos on a new following', async function () { | ||
167 | this.timeout(20000) | ||
168 | |||
169 | await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3-2' }) | ||
170 | await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3-3' }) | ||
171 | await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3-4' }) | ||
172 | await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3-5' }) | ||
173 | await uploadVideo(servers[2].url, servers[2].accessToken, { name: 'server3-6' }) | ||
174 | |||
175 | await wait(5000) | ||
176 | |||
177 | // Server 1 follows server 3 | ||
178 | await follow(servers[0].url, [ servers[2].url ], servers[0].accessToken) | ||
179 | |||
180 | await wait(7000) | ||
181 | |||
182 | let res = await getVideosList(servers[0].url) | ||
183 | expect(res.body.total).to.equal(7) | ||
184 | |||
185 | const video2 = res.body.data.find(v => v.name === 'server3-2') | ||
186 | const video4 = res.body.data.find(v => v.name === 'server3-4') | ||
187 | const video6 = res.body.data.find(v => v.name === 'server3-6') | ||
188 | |||
189 | expect(video2).to.not.be.undefined | ||
190 | expect(video4).to.not.be.undefined | ||
191 | expect(video6).to.not.be.undefined | ||
192 | }) | ||
193 | |||
166 | after(async function () { | 194 | after(async function () { |
167 | killallServers(servers) | 195 | killallServers(servers) |
168 | 196 | ||