aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/video-captions.ts26
-rw-r--r--server/tests/api/videos/video-captions.ts3
2 files changed, 28 insertions, 1 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'
17import { join } from 'path' 17import { join } from 'path'
18import { createVideoCaption } from '../../utils/videos/video-captions'
18 19
19describe('Test video captions API validator', function () { 20describe('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')
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index eb73c5baf..ba9ebbdd6 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -56,7 +56,8 @@ describe('Test video captions', function () {
56 accessToken: servers[0].accessToken, 56 accessToken: servers[0].accessToken,
57 language: 'zh', 57 language: 'zh',
58 videoId: videoUUID, 58 videoId: videoUUID,
59 fixture: 'subtitle-good2.vtt' 59 fixture: 'subtitle-good2.vtt',
60 mimeType: 'application/octet-stream'
60 }) 61 })
61 62
62 await waitJobs(servers) 63 await waitJobs(servers)