aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-29 11:29:23 +0200
committerChocobozzz <me@florianbigard.com>2018-06-29 11:29:23 +0200
commit4bbfc6c606c8d3794bae25c64c516120af41f4eb (patch)
tree8d6012f3c04e55e7325e3f00eb9061776cc7a953 /server/tests/api/videos/video-channels.ts
parent3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce (diff)
downloadPeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.tar.gz
PeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.tar.zst
PeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.zip
API: Add ability to update video channel avatar
Diffstat (limited to 'server/tests/api/videos/video-channels.ts')
-rw-r--r--server/tests/api/videos/video-channels.ts34
1 files changed, 33 insertions, 1 deletions
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index ad543e2d6..e4e3ce9d9 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -3,7 +3,14 @@
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { User, Video } from '../../../../shared/index' 5import { User, Video } from '../../../../shared/index'
6import { doubleFollow, flushAndRunMultipleServers, getVideoChannelVideos, updateVideo, uploadVideo } from '../../utils' 6import {
7 doubleFollow,
8 flushAndRunMultipleServers,
9 getVideoChannelVideos, testImage,
10 updateVideo,
11 updateVideoChannelAvatar,
12 uploadVideo, wait
13} from '../../utils'
7import { 14import {
8 addVideoChannel, 15 addVideoChannel,
9 deleteVideoChannel, 16 deleteVideoChannel,
@@ -159,6 +166,31 @@ describe('Test video channels', function () {
159 } 166 }
160 }) 167 })
161 168
169 it('Should update video channel avatar', async function () {
170 this.timeout(5000)
171
172 const fixture = 'avatar.png'
173
174 await updateVideoChannelAvatar({
175 url: servers[0].url,
176 accessToken: servers[0].accessToken,
177 videoChannelId: secondVideoChannelId,
178 fixture
179 })
180
181 await waitJobs(servers)
182 })
183
184 it('Should have video channel avatar updated', async function () {
185 for (const server of servers) {
186 const res = await getVideoChannelsList(server.url, 0, 1, '-name')
187
188 const videoChannel = res.body.data.find(c => c.id === secondVideoChannelId)
189
190 await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png')
191 }
192 })
193
162 it('Should get video channel', async function () { 194 it('Should get video channel', async function () {
163 const res = await getVideoChannel(servers[0].url, secondVideoChannelId) 195 const res = await getVideoChannel(servers[0].url, secondVideoChannelId)
164 196