diff options
Diffstat (limited to 'server/tests/api/videos/video-channels.ts')
-rw-r--r-- | server/tests/api/videos/video-channels.ts | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index c25754eb6..6ab5faa07 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -33,6 +33,7 @@ describe('Test video channels', function () { | |||
33 | let totoChannel: number | 33 | let totoChannel: number |
34 | let videoUUID: string | 34 | let videoUUID: string |
35 | let accountName: string | 35 | let accountName: string |
36 | let secondUserChannelName: string | ||
36 | 37 | ||
37 | const avatarPaths: { [ port: number ]: string } = {} | 38 | const avatarPaths: { [ port: number ]: string } = {} |
38 | const bannerPaths: { [ port: number ]: string } = {} | 39 | const bannerPaths: { [ port: number ]: string } = {} |
@@ -219,6 +220,35 @@ describe('Test video channels', function () { | |||
219 | } | 220 | } |
220 | }) | 221 | }) |
221 | 222 | ||
223 | it('Should update another accounts video channel', async function () { | ||
224 | this.timeout(15000) | ||
225 | |||
226 | const result = await servers[0].users.generate('second_user') | ||
227 | secondUserChannelName = result.userChannelName | ||
228 | |||
229 | await servers[0].videos.quickUpload({ name: 'video', token: result.token }) | ||
230 | |||
231 | const videoChannelAttributes = { | ||
232 | displayName: 'video channel updated', | ||
233 | description: 'video channel description updated', | ||
234 | support: 'support updated' | ||
235 | } | ||
236 | |||
237 | await servers[0].channels.update({ channelName: secondUserChannelName, attributes: videoChannelAttributes }) | ||
238 | |||
239 | await waitJobs(servers) | ||
240 | }) | ||
241 | |||
242 | it('Should have another accounts video channel updated', async function () { | ||
243 | for (const server of servers) { | ||
244 | const body = await server.channels.get({ channelName: `${secondUserChannelName}@${servers[0].host}` }) | ||
245 | |||
246 | expect(body.displayName).to.equal('video channel updated') | ||
247 | expect(body.description).to.equal('video channel description updated') | ||
248 | expect(body.support).to.equal('support updated') | ||
249 | } | ||
250 | }) | ||
251 | |||
222 | it('Should update the channel support field and update videos too', async function () { | 252 | it('Should update the channel support field and update videos too', async function () { |
223 | this.timeout(35000) | 253 | this.timeout(35000) |
224 | 254 | ||
@@ -368,12 +398,13 @@ describe('Test video channels', function () { | |||
368 | }) | 398 | }) |
369 | 399 | ||
370 | it('Should have video channel deleted', async function () { | 400 | it('Should have video channel deleted', async function () { |
371 | const body = await servers[0].channels.list({ start: 0, count: 10 }) | 401 | const body = await servers[0].channels.list({ start: 0, count: 10, sort: 'createdAt' }) |
372 | 402 | ||
373 | expect(body.total).to.equal(1) | 403 | expect(body.total).to.equal(2) |
374 | expect(body.data).to.be.an('array') | 404 | expect(body.data).to.be.an('array') |
375 | expect(body.data).to.have.lengthOf(1) | 405 | expect(body.data).to.have.lengthOf(2) |
376 | expect(body.data[0].displayName).to.equal('Main root channel') | 406 | expect(body.data[0].displayName).to.equal('Main root channel') |
407 | expect(body.data[1].displayName).to.equal('video channel updated') | ||
377 | }) | 408 | }) |
378 | 409 | ||
379 | it('Should create the main channel with an uuid if there is a conflict', async function () { | 410 | it('Should create the main channel with an uuid if there is a conflict', async function () { |