diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-29 11:29:23 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-29 11:29:23 +0200 |
commit | 4bbfc6c606c8d3794bae25c64c516120af41f4eb (patch) | |
tree | 8d6012f3c04e55e7325e3f00eb9061776cc7a953 /server/tests/utils/videos | |
parent | 3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce (diff) | |
download | PeerTube-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.ts | 14 |
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 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' | 2 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared/models/videos' |
3 | import { updateAvatarRequest } from '../index' | ||
3 | 4 | ||
4 | function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { | 5 | function 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 | ||
96 | function 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 | ||
97 | export { | 110 | export { |
111 | updateVideoChannelAvatar, | ||
98 | getVideoChannelsList, | 112 | getVideoChannelsList, |
99 | getAccountVideoChannelsList, | 113 | getAccountVideoChannelsList, |
100 | addVideoChannel, | 114 | addVideoChannel, |