aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/utils/videos/videos.ts')
-rw-r--r--server/tests/utils/videos/videos.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 943c85cc7..2ba3a860b 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -167,6 +167,46 @@ function getMyVideos (url: string, accessToken: string, start: number, count: nu
167 .expect('Content-Type', /json/) 167 .expect('Content-Type', /json/)
168} 168}
169 169
170function getAccountVideos (url: string, accessToken: string, accountId: number | string, start: number, count: number, sort?: string) {
171 const path = '/api/v1/accounts/' + accountId + '/videos'
172
173 return makeGetRequest({
174 url,
175 path,
176 query: {
177 start,
178 count,
179 sort
180 },
181 token: accessToken,
182 statusCodeExpected: 200
183 })
184}
185
186function getVideoChannelVideos (
187 url: string,
188 accessToken: string,
189 accountId: number | string,
190 videoChannelId: number | string,
191 start: number,
192 count: number,
193 sort?: string
194) {
195 const path = '/api/v1/accounts/' + accountId + '/video-channels/' + videoChannelId + '/videos'
196
197 return makeGetRequest({
198 url,
199 path,
200 query: {
201 start,
202 count,
203 sort
204 },
205 token: accessToken,
206 statusCodeExpected: 200
207 })
208}
209
170function getVideosListPagination (url: string, start: number, count: number, sort?: string) { 210function getVideosListPagination (url: string, start: number, count: number, sort?: string) {
171 const path = '/api/v1/videos' 211 const path = '/api/v1/videos'
172 212
@@ -514,6 +554,8 @@ export {
514 getVideoPrivacies, 554 getVideoPrivacies,
515 getVideoLanguages, 555 getVideoLanguages,
516 getMyVideos, 556 getMyVideos,
557 getAccountVideos,
558 getVideoChannelVideos,
517 searchVideoWithToken, 559 searchVideoWithToken,
518 getVideo, 560 getVideo,
519 getVideoWithToken, 561 getVideoWithToken,