diff options
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/video-captions.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index a3d7ac35d..8d46971a1 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts | |||
@@ -15,6 +15,7 @@ import { | |||
15 | userLogin | 15 | userLogin |
16 | } from '../../utils' | 16 | } from '../../utils' |
17 | import { join } from 'path' | 17 | import { join } from 'path' |
18 | import { createVideoCaption } from '../../utils/videos/video-captions' | ||
18 | 19 | ||
19 | describe('Test video captions API validator', function () { | 20 | describe('Test video captions API validator', function () { |
20 | const path = '/api/v1/videos/' | 21 | const path = '/api/v1/videos/' |
@@ -143,6 +144,31 @@ describe('Test video captions API validator', function () { | |||
143 | }) | 144 | }) |
144 | }) | 145 | }) |
145 | 146 | ||
147 | // We don't check the extension yet | ||
148 | // it('Should fail with an invalid captionfile extension and octet-stream mime type', async function () { | ||
149 | // await createVideoCaption({ | ||
150 | // url: server.url, | ||
151 | // accessToken: server.accessToken, | ||
152 | // language: 'zh', | ||
153 | // videoId: videoUUID, | ||
154 | // fixture: 'subtitle-bad.txt', | ||
155 | // mimeType: 'application/octet-stream', | ||
156 | // statusCodeExpected: 400 | ||
157 | // }) | ||
158 | // }) | ||
159 | |||
160 | it('Should succeed with a valid captionfile extension and octet-stream mime type', async function () { | ||
161 | await createVideoCaption({ | ||
162 | url: server.url, | ||
163 | accessToken: server.accessToken, | ||
164 | language: 'zh', | ||
165 | videoId: videoUUID, | ||
166 | fixture: 'subtitle-good.srt', | ||
167 | mimeType: 'application/octet-stream' | ||
168 | }) | ||
169 | }) | ||
170 | |||
171 | // We don't check the file validity yet | ||
146 | // it('Should fail with an invalid captionfile srt', async function () { | 172 | // it('Should fail with an invalid captionfile srt', async function () { |
147 | // const attaches = { | 173 | // const attaches = { |
148 | // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt') | 174 | // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt') |