aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-captions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/video-captions.ts')
-rw-r--r--server/tests/api/check-params/video-captions.ts30
1 files changed, 15 insertions, 15 deletions
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index 26aab79e7..1b3d1aa95 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -1,7 +1,7 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { HttpStatusCode } from '@shared/core-utils' 4import { HttpStatusCode } from '@shared/models'
5import { 5import {
6 buildAbsoluteFixturePath, 6 buildAbsoluteFixturePath,
7 cleanupTests, 7 cleanupTests,
@@ -67,7 +67,7 @@ describe('Test video captions API validator', function () {
67 token: server.accessToken, 67 token: server.accessToken,
68 fields, 68 fields,
69 attaches, 69 attaches,
70 statusCodeExpected: 404 70 expectedStatus: 404
71 }) 71 })
72 }) 72 })
73 73
@@ -103,7 +103,7 @@ describe('Test video captions API validator', function () {
103 path: captionPath, 103 path: captionPath,
104 fields, 104 fields,
105 attaches, 105 attaches,
106 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 106 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
107 }) 107 })
108 }) 108 })
109 109
@@ -116,7 +116,7 @@ describe('Test video captions API validator', function () {
116 token: 'blabla', 116 token: 'blabla',
117 fields, 117 fields,
118 attaches, 118 attaches,
119 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 119 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
120 }) 120 })
121 }) 121 })
122 122
@@ -134,7 +134,7 @@ describe('Test video captions API validator', function () {
134 // token: server.accessToken, 134 // token: server.accessToken,
135 // fields, 135 // fields,
136 // attaches, 136 // attaches,
137 // statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 137 // expectedStatus: HttpStatusCode.BAD_REQUEST_400
138 // }) 138 // })
139 // }) 139 // })
140 140
@@ -147,7 +147,7 @@ describe('Test video captions API validator', function () {
147 // videoId: video.uuid, 147 // videoId: video.uuid,
148 // fixture: 'subtitle-bad.txt', 148 // fixture: 'subtitle-bad.txt',
149 // mimeType: 'application/octet-stream', 149 // mimeType: 'application/octet-stream',
150 // statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 150 // expectedStatus: HttpStatusCode.BAD_REQUEST_400
151 // }) 151 // })
152 // }) 152 // })
153 153
@@ -174,7 +174,7 @@ describe('Test video captions API validator', function () {
174 // token: server.accessToken, 174 // token: server.accessToken,
175 // fields, 175 // fields,
176 // attaches, 176 // attaches,
177 // statusCodeExpected: HttpStatusCode.INTERNAL_SERVER_ERROR_500 177 // expectedStatus: HttpStatusCode.INTERNAL_SERVER_ERROR_500
178 // }) 178 // })
179 // }) 179 // })
180 180
@@ -187,7 +187,7 @@ describe('Test video captions API validator', function () {
187 token: server.accessToken, 187 token: server.accessToken,
188 fields, 188 fields,
189 attaches, 189 attaches,
190 statusCodeExpected: HttpStatusCode.NO_CONTENT_204 190 expectedStatus: HttpStatusCode.NO_CONTENT_204
191 }) 191 })
192 }) 192 })
193 }) 193 })
@@ -201,12 +201,12 @@ describe('Test video captions API validator', function () {
201 await makeGetRequest({ 201 await makeGetRequest({
202 url: server.url, 202 url: server.url,
203 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions', 203 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions',
204 statusCodeExpected: HttpStatusCode.NOT_FOUND_404 204 expectedStatus: HttpStatusCode.NOT_FOUND_404
205 }) 205 })
206 }) 206 })
207 207
208 it('Should success with the correct parameters', async function () { 208 it('Should success with the correct parameters', async function () {
209 await makeGetRequest({ url: server.url, path: path + video.shortUUID + '/captions', statusCodeExpected: HttpStatusCode.OK_200 }) 209 await makeGetRequest({ url: server.url, path: path + video.shortUUID + '/captions', expectedStatus: HttpStatusCode.OK_200 })
210 }) 210 })
211 }) 211 })
212 212
@@ -224,7 +224,7 @@ describe('Test video captions API validator', function () {
224 url: server.url, 224 url: server.url,
225 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions/fr', 225 path: path + '4da6fde3-88f7-4d16-b119-108df5630b06/captions/fr',
226 token: server.accessToken, 226 token: server.accessToken,
227 statusCodeExpected: HttpStatusCode.NOT_FOUND_404 227 expectedStatus: HttpStatusCode.NOT_FOUND_404
228 }) 228 })
229 }) 229 })
230 230
@@ -248,12 +248,12 @@ describe('Test video captions API validator', function () {
248 248
249 it('Should fail without access token', async function () { 249 it('Should fail without access token', async function () {
250 const captionPath = path + video.shortUUID + '/captions/fr' 250 const captionPath = path + video.shortUUID + '/captions/fr'
251 await makeDeleteRequest({ url: server.url, path: captionPath, statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 }) 251 await makeDeleteRequest({ url: server.url, path: captionPath, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
252 }) 252 })
253 253
254 it('Should fail with a bad access token', async function () { 254 it('Should fail with a bad access token', async function () {
255 const captionPath = path + video.shortUUID + '/captions/fr' 255 const captionPath = path + video.shortUUID + '/captions/fr'
256 await makeDeleteRequest({ url: server.url, path: captionPath, token: 'coucou', statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 }) 256 await makeDeleteRequest({ url: server.url, path: captionPath, token: 'coucou', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
257 }) 257 })
258 258
259 it('Should fail with another user', async function () { 259 it('Should fail with another user', async function () {
@@ -262,7 +262,7 @@ describe('Test video captions API validator', function () {
262 url: server.url, 262 url: server.url,
263 path: captionPath, 263 path: captionPath,
264 token: userAccessToken, 264 token: userAccessToken,
265 statusCodeExpected: HttpStatusCode.FORBIDDEN_403 265 expectedStatus: HttpStatusCode.FORBIDDEN_403
266 }) 266 })
267 }) 267 })
268 268
@@ -272,7 +272,7 @@ describe('Test video captions API validator', function () {
272 url: server.url, 272 url: server.url,
273 path: captionPath, 273 path: captionPath,
274 token: server.accessToken, 274 token: server.accessToken,
275 statusCodeExpected: HttpStatusCode.NO_CONTENT_204 275 expectedStatus: HttpStatusCode.NO_CONTENT_204
276 }) 276 })
277 }) 277 })
278 }) 278 })