aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos
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/utils/videos
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/utils/videos')
-rw-r--r--server/tests/utils/videos/video-channels.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts
index a064598f4..3ca39469c 100644
--- a/server/tests/utils/videos/video-channels.ts
+++ b/server/tests/utils/videos/video-channels.ts
@@ -1,5 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' 2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos'
3import { updateAvatarRequest } from '../index'
3 4
4function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { 5function getVideoChannelsList (url: string, start: number, count: number, sort?: string) {
5 const path = '/api/v1/video-channels' 6 const path = '/api/v1/video-channels'
@@ -92,9 +93,22 @@ function getVideoChannel (url: string, channelId: number | string) {
92 .expect('Content-Type', /json/) 93 .expect('Content-Type', /json/)
93} 94}
94 95
96function updateVideoChannelAvatar (options: {
97 url: string,
98 accessToken: string,
99 fixture: string,
100 videoChannelId: string | number
101}) {
102
103 const path = '/api/v1/video-channels/' + options.videoChannelId + '/avatar/pick'
104
105 return updateAvatarRequest(Object.assign(options, { path }))
106}
107
95// --------------------------------------------------------------------------- 108// ---------------------------------------------------------------------------
96 109
97export { 110export {
111 updateVideoChannelAvatar,
98 getVideoChannelsList, 112 getVideoChannelsList,
99 getAccountVideoChannelsList, 113 getAccountVideoChannelsList,
100 addVideoChannel, 114 addVideoChannel,