]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-channels.ts
Don't set a bitrate on unknown audio input
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-channels.ts
index ad543e2d6c31df9c908fd69732fc31b890559e94..e4e3ce9d9e78a2498b8d197e81eb4118e5fa6fd1 100644 (file)
@@ -3,7 +3,14 @@
 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,
@@ -159,6 +166,31 @@ describe('Test video channels', function () {
     }
   })
 
+  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)