+ it('Should update video channel avatar', async function () {
+ this.timeout(15000)
+
+ const fixture = 'avatar.png'
+
+ await updateVideoChannelImage({
+ url: servers[0].url,
+ accessToken: servers[0].accessToken,
+ videoChannelName: 'second_video_channel',
+ fixture,
+ type: 'avatar'
+ })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const videoChannel = await findChannel(server, secondVideoChannelId)
+
+ await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png')
+
+ const row = await getActorImage(server.internalServerNumber, basename(videoChannel.avatar.path))
+ expect(row.height).to.equal(ACTOR_IMAGES_SIZE.AVATARS.height)
+ expect(row.width).to.equal(ACTOR_IMAGES_SIZE.AVATARS.width)
+ }
+ })
+
+ it('Should update video channel banner', async function () {
+ this.timeout(15000)
+
+ const fixture = 'banner.jpg'
+
+ await updateVideoChannelImage({
+ url: servers[0].url,
+ accessToken: servers[0].accessToken,
+ videoChannelName: 'second_video_channel',
+ fixture,
+ type: 'banner'
+ })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const res = await getVideoChannel(server.url, 'second_video_channel@' + servers[0].host)
+ const videoChannel = res.body
+
+ await testImage(server.url, 'banner-resized', videoChannel.banner.path)
+
+ const row = await getActorImage(server.internalServerNumber, basename(videoChannel.banner.path))
+ expect(row.height).to.equal(ACTOR_IMAGES_SIZE.BANNERS.height)
+ expect(row.width).to.equal(ACTOR_IMAGES_SIZE.BANNERS.width)
+ }
+ })
+
+ it('Should delete the video channel avatar', async function () {
+ this.timeout(15000)
+
+ await deleteVideoChannelImage({
+ url: servers[0].url,
+ accessToken: servers[0].accessToken,
+ videoChannelName: 'second_video_channel',
+ type: 'avatar'
+ })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const videoChannel = await findChannel(server, secondVideoChannelId)
+
+ expect(videoChannel.avatar).to.be.null
+ }
+ })
+
+ it('Should delete the video channel banner', async function () {
+ this.timeout(15000)
+
+ await deleteVideoChannelImage({
+ url: servers[0].url,
+ accessToken: servers[0].accessToken,
+ videoChannelName: 'second_video_channel',
+ type: 'banner'
+ })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const videoChannel = await findChannel(server, secondVideoChannelId)
+
+ expect(videoChannel.banner).to.be.null
+ }
+ })
+
+ it('Should list the second video channel videos', async function () {
+ this.timeout(10000)
+
+ for (const server of servers) {
+ const channelURI = 'second_video_channel@localhost:' + servers[0].port
+ const res1 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5)
+ expect(res1.body.total).to.equal(1)
+ expect(res1.body.data).to.be.an('array')
+ expect(res1.body.data).to.have.lengthOf(1)
+ expect(res1.body.data[0].name).to.equal('my video name')
+ }
+ })
+
+ it('Should change the video channel of a video', async function () {
+ this.timeout(10000)
+
+ await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, { channelId: firstVideoChannelId })
+
+ await waitJobs(servers)
+ })
+
+ it('Should list the first video channel videos', async function () {
+ this.timeout(10000)
+
+ for (const server of servers) {
+ const secondChannelURI = 'second_video_channel@localhost:' + servers[0].port
+ const res1 = await getVideoChannelVideos(server.url, server.accessToken, secondChannelURI, 0, 5)
+ expect(res1.body.total).to.equal(0)
+
+ const channelURI = 'root_channel@localhost:' + servers[0].port
+ const res2 = await getVideoChannelVideos(server.url, server.accessToken, channelURI, 0, 5)
+ expect(res2.body.total).to.equal(1)
+
+ const videos: Video[] = res2.body.data
+ expect(videos).to.be.an('array')
+ expect(videos).to.have.lengthOf(1)
+ expect(videos[0].name).to.equal('my video name')
+ }
+ })
+
+ it('Should delete video channel', async function () {
+ await deleteVideoChannel(servers[0].url, servers[0].accessToken, 'second_video_channel')
+ })
+
+ it('Should have video channel deleted', async function () {
+ const res = await getVideoChannelsList(servers[0].url, 0, 10)