aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-16 14:22:16 +0200
committerChocobozzz <me@florianbigard.com>2018-07-16 14:31:40 +0200
commitf4001cf408a99049d01a356bfb20a62342de06ea (patch)
tree421776dfe64335dca2725ac3ac5f3b3e6b7564c6 /server/tests/api/check-params
parent16f7022b06fb76c0b00c23c970bc8df605b0ec63 (diff)
downloadPeerTube-f4001cf408a99049d01a356bfb20a62342de06ea.tar.gz
PeerTube-f4001cf408a99049d01a356bfb20a62342de06ea.tar.zst
PeerTube-f4001cf408a99049d01a356bfb20a62342de06ea.zip
Handle .srt subtitles
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/video-captions.ts35
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
3import * as chai from 'chai'
4import 'mocha' 3import 'mocha'
5import { 4import {
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({