import * as chai from 'chai'
import 'mocha'
import { User, Video } from '../../../../shared/index'
-import { doubleFollow, flushAndRunMultipleServers, getVideoChannelVideos, updateVideo, uploadVideo } from '../../utils'
+import {
+ doubleFollow,
+ flushAndRunMultipleServers,
+ getVideoChannelVideos, testImage,
+ updateVideo,
+ updateVideoChannelAvatar,
+ uploadVideo, wait
+} from '../../utils'
import {
addVideoChannel,
deleteVideoChannel,
}
})
+ it('Should update video channel avatar', async function () {
+ this.timeout(5000)
+
+ const fixture = 'avatar.png'
+
+ await updateVideoChannelAvatar({
+ url: servers[0].url,
+ accessToken: servers[0].accessToken,
+ videoChannelId: secondVideoChannelId,
+ fixture
+ })
+
+ await waitJobs(servers)
+ })
+
+ it('Should have video channel avatar updated', async function () {
+ for (const server of servers) {
+ const res = await getVideoChannelsList(server.url, 0, 1, '-name')
+
+ const videoChannel = res.body.data.find(c => c.id === secondVideoChannelId)
+
+ await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png')
+ }
+ })
+
it('Should get video channel', async function () {
const res = await getVideoChannel(servers[0].url, secondVideoChannelId)