diff options
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r-- | server/tests/api/check-params/videos.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index b9484afc4..5c067dc96 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -100,6 +100,7 @@ describe('Test videos API validator', function () { | |||
100 | licence: 1, | 100 | licence: 1, |
101 | language: 6, | 101 | language: 6, |
102 | nsfw: false, | 102 | nsfw: false, |
103 | commentsEnabled: true, | ||
103 | description: 'my super description', | 104 | description: 'my super description', |
104 | tags: [ 'tag1', 'tag2' ], | 105 | tags: [ 'tag1', 'tag2' ], |
105 | privacy: VideoPrivacy.PUBLIC, | 106 | privacy: VideoPrivacy.PUBLIC, |
@@ -162,6 +163,20 @@ describe('Test videos API validator', function () { | |||
162 | await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 163 | await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
163 | }) | 164 | }) |
164 | 165 | ||
166 | it('Should fail without commentsEnabled attribute', async function () { | ||
167 | const fields = omit(baseCorrectParams, 'commentsEnabled') | ||
168 | const attaches = baseCorrectAttaches | ||
169 | |||
170 | await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | ||
171 | }) | ||
172 | |||
173 | it('Should fail with a bad commentsEnabled attribute', async function () { | ||
174 | const fields = immutableAssign(baseCorrectParams, { commentsEnabled: 2 }) | ||
175 | const attaches = baseCorrectAttaches | ||
176 | |||
177 | await makePostUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | ||
178 | }) | ||
179 | |||
165 | it('Should fail with a long description', async function () { | 180 | it('Should fail with a long description', async function () { |
166 | const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) }) | 181 | const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) }) |
167 | const attaches = baseCorrectAttaches | 182 | const attaches = baseCorrectAttaches |
@@ -291,6 +306,7 @@ describe('Test videos API validator', function () { | |||
291 | licence: 2, | 306 | licence: 2, |
292 | language: 6, | 307 | language: 6, |
293 | nsfw: false, | 308 | nsfw: false, |
309 | commentsEnabled: false, | ||
294 | description: 'my super description', | 310 | description: 'my super description', |
295 | privacy: VideoPrivacy.PUBLIC, | 311 | privacy: VideoPrivacy.PUBLIC, |
296 | tags: [ 'tag1', 'tag2' ] | 312 | tags: [ 'tag1', 'tag2' ] |
@@ -354,6 +370,12 @@ describe('Test videos API validator', function () { | |||
354 | await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) | 370 | await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) |
355 | }) | 371 | }) |
356 | 372 | ||
373 | it('Should fail with a bad commentsEnabled attribute', async function () { | ||
374 | const fields = immutableAssign(baseCorrectParams, { commentsEnabled: 2 }) | ||
375 | |||
376 | await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) | ||
377 | }) | ||
378 | |||
357 | it('Should fail with a long description', async function () { | 379 | it('Should fail with a long description', async function () { |
358 | const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) }) | 380 | const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(1500) }) |
359 | 381 | ||