diff options
Diffstat (limited to 'server/tests/api/check-params/video-captions.ts')
-rw-r--r-- | server/tests/api/check-params/video-captions.ts | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index 12f890db8..a3d7ac35d 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
5 | import { | 4 | import { |
6 | createUser, | 5 | createUser, |
@@ -127,6 +126,40 @@ describe('Test video captions API validator', function () { | |||
127 | }) | 126 | }) |
128 | }) | 127 | }) |
129 | 128 | ||
129 | it('Should fail with an invalid captionfile extension', async function () { | ||
130 | const attaches = { | ||
131 | 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.txt') | ||
132 | } | ||
133 | |||
134 | const captionPath = path + videoUUID + '/captions/fr' | ||
135 | await makeUploadRequest({ | ||
136 | method: 'PUT', | ||
137 | url: server.url, | ||
138 | path: captionPath, | ||
139 | token: server.accessToken, | ||
140 | fields, | ||
141 | attaches, | ||
142 | statusCodeExpected: 400 | ||
143 | }) | ||
144 | }) | ||
145 | |||
146 | // it('Should fail with an invalid captionfile srt', async function () { | ||
147 | // const attaches = { | ||
148 | // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt') | ||
149 | // } | ||
150 | // | ||
151 | // const captionPath = path + videoUUID + '/captions/fr' | ||
152 | // await makeUploadRequest({ | ||
153 | // method: 'PUT', | ||
154 | // url: server.url, | ||
155 | // path: captionPath, | ||
156 | // token: server.accessToken, | ||
157 | // fields, | ||
158 | // attaches, | ||
159 | // statusCodeExpected: 500 | ||
160 | // }) | ||
161 | // }) | ||
162 | |||
130 | it('Should success with the correct parameters', async function () { | 163 | it('Should success with the correct parameters', async function () { |
131 | const captionPath = path + videoUUID + '/captions/fr' | 164 | const captionPath = path + videoUUID + '/captions/fr' |
132 | await makeUploadRequest({ | 165 | await makeUploadRequest({ |