diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-26 09:38:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-26 09:42:44 +0200 |
commit | 22e7ffc7810798a0aa34145f2e06e62d6004b253 (patch) | |
tree | 09c9f445e82f30683bae38ad185a461ac05e2989 /server/tests/shared/videos.ts | |
parent | 93fd6f3b18e1c0009ff6ca9208966ae36af5dafa (diff) | |
download | PeerTube-22e7ffc7810798a0aa34145f2e06e62d6004b253.tar.gz PeerTube-22e7ffc7810798a0aa34145f2e06e62d6004b253.tar.zst PeerTube-22e7ffc7810798a0aa34145f2e06e62d6004b253.zip |
Fix check params tests
Diffstat (limited to 'server/tests/shared/videos.ts')
-rw-r--r-- | server/tests/shared/videos.ts | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/server/tests/shared/videos.ts b/server/tests/shared/videos.ts index 3f59c329f..ac24bb173 100644 --- a/server/tests/shared/videos.ts +++ b/server/tests/shared/videos.ts | |||
@@ -268,16 +268,25 @@ async function saveVideoInServers (servers: PeerTubeServer[], uuid: string) { | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | function checkUploadVideoParam ( | 271 | function checkUploadVideoParam (options: { |
272 | server: PeerTubeServer, | 272 | server: PeerTubeServer |
273 | token: string, | 273 | token: string |
274 | attributes: Partial<VideoEdit>, | 274 | attributes: Partial<VideoEdit> |
275 | expectedStatus = HttpStatusCode.OK_200, | 275 | expectedStatus?: HttpStatusCode |
276 | mode: 'legacy' | 'resumable' = 'legacy' | 276 | completedExpectedStatus?: HttpStatusCode |
277 | ) { | 277 | mode?: 'legacy' | 'resumable' |
278 | }) { | ||
279 | const { server, token, attributes, completedExpectedStatus, expectedStatus, mode = 'legacy' } = options | ||
280 | |||
278 | return mode === 'legacy' | 281 | return mode === 'legacy' |
279 | ? server.videos.buildLegacyUpload({ token, attributes, expectedStatus }) | 282 | ? server.videos.buildLegacyUpload({ token, attributes, expectedStatus: expectedStatus || completedExpectedStatus }) |
280 | : server.videos.buildResumeUpload({ token, attributes, expectedStatus, path: '/api/v1/videos/upload-resumable' }) | 283 | : server.videos.buildResumeUpload({ |
284 | token, | ||
285 | attributes, | ||
286 | expectedStatus, | ||
287 | completedExpectedStatus, | ||
288 | path: '/api/v1/videos/upload-resumable' | ||
289 | }) | ||
281 | } | 290 | } |
282 | 291 | ||
283 | // serverNumber starts from 1 | 292 | // serverNumber starts from 1 |