diff options
Diffstat (limited to 'server/tests/utils/videos')
-rw-r--r-- | server/tests/utils/videos/video-captions.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/tests/utils/videos/video-captions.ts b/server/tests/utils/videos/video-captions.ts index 207e89632..41e52be07 100644 --- a/server/tests/utils/videos/video-captions.ts +++ b/server/tests/utils/videos/video-captions.ts | |||
@@ -10,10 +10,15 @@ function createVideoCaption (args: { | |||
10 | accessToken: string | 10 | accessToken: string |
11 | videoId: string | number | 11 | videoId: string | number |
12 | language: string | 12 | language: string |
13 | fixture: string | 13 | fixture: string, |
14 | mimeType?: string, | ||
15 | statusCodeExpected?: number | ||
14 | }) { | 16 | }) { |
15 | const path = '/api/v1/videos/' + args.videoId + '/captions/' + args.language | 17 | const path = '/api/v1/videos/' + args.videoId + '/captions/' + args.language |
16 | 18 | ||
19 | const captionfile = buildAbsoluteFixturePath(args.fixture) | ||
20 | const captionfileAttach = args.mimeType ? [ captionfile, { contentType: args.mimeType } ] : captionfile | ||
21 | |||
17 | return makeUploadRequest({ | 22 | return makeUploadRequest({ |
18 | method: 'PUT', | 23 | method: 'PUT', |
19 | url: args.url, | 24 | url: args.url, |
@@ -21,9 +26,9 @@ function createVideoCaption (args: { | |||
21 | token: args.accessToken, | 26 | token: args.accessToken, |
22 | fields: {}, | 27 | fields: {}, |
23 | attaches: { | 28 | attaches: { |
24 | captionfile: buildAbsoluteFixturePath(args.fixture) | 29 | captionfile: captionfileAttach |
25 | }, | 30 | }, |
26 | statusCodeExpected: 204 | 31 | statusCodeExpected: args.statusCodeExpected || 204 |
27 | }) | 32 | }) |
28 | } | 33 | } |
29 | 34 | ||