diff options
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r-- | server/tests/api/check-params/videos.ts | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 16ef1c505..0d4665954 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
@@ -56,8 +56,8 @@ describe('Test videos API validator', function () { | |||
56 | 56 | ||
57 | { | 57 | { |
58 | const res = await getMyUserInformation(server.url, server.accessToken) | 58 | const res = await getMyUserInformation(server.url, server.accessToken) |
59 | channelId = res.body.videoChannels[ 0 ].id | 59 | channelId = res.body.videoChannels[0].id |
60 | channelName = res.body.videoChannels[ 0 ].name | 60 | channelName = res.body.videoChannels[0].name |
61 | accountName = res.body.account.name + '@' + res.body.account.host | 61 | accountName = res.body.account.name + '@' + res.body.account.host |
62 | } | 62 | } |
63 | }) | 63 | }) |
@@ -182,7 +182,7 @@ describe('Test videos API validator', function () { | |||
182 | describe('When adding a video', function () { | 182 | describe('When adding a video', function () { |
183 | let baseCorrectParams | 183 | let baseCorrectParams |
184 | const baseCorrectAttaches = { | 184 | const baseCorrectAttaches = { |
185 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.webm') | 185 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.webm') |
186 | } | 186 | } |
187 | 187 | ||
188 | before(function () { | 188 | before(function () { |
@@ -330,7 +330,7 @@ describe('Test videos API validator', function () { | |||
330 | }) | 330 | }) |
331 | 331 | ||
332 | it('Should fail with a bad originally published at attribute', async function () { | 332 | it('Should fail with a bad originally published at attribute', async function () { |
333 | const fields = immutableAssign(baseCorrectParams, { 'originallyPublishedAt': 'toto' }) | 333 | const fields = immutableAssign(baseCorrectParams, { originallyPublishedAt: 'toto' }) |
334 | const attaches = baseCorrectAttaches | 334 | const attaches = baseCorrectAttaches |
335 | 335 | ||
336 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 336 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -345,12 +345,12 @@ describe('Test videos API validator', function () { | |||
345 | it('Should fail with an incorrect input file', async function () { | 345 | it('Should fail with an incorrect input file', async function () { |
346 | const fields = baseCorrectParams | 346 | const fields = baseCorrectParams |
347 | let attaches = { | 347 | let attaches = { |
348 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short_fake.webm') | 348 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short_fake.webm') |
349 | } | 349 | } |
350 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 350 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
351 | 351 | ||
352 | attaches = { | 352 | attaches = { |
353 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.mkv') | 353 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mkv') |
354 | } | 354 | } |
355 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 355 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
356 | }) | 356 | }) |
@@ -358,8 +358,8 @@ describe('Test videos API validator', function () { | |||
358 | it('Should fail with an incorrect thumbnail file', async function () { | 358 | it('Should fail with an incorrect thumbnail file', async function () { |
359 | const fields = baseCorrectParams | 359 | const fields = baseCorrectParams |
360 | const attaches = { | 360 | const attaches = { |
361 | 'thumbnailfile': join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), | 361 | thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), |
362 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') | 362 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') |
363 | } | 363 | } |
364 | 364 | ||
365 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 365 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -368,8 +368,8 @@ describe('Test videos API validator', function () { | |||
368 | it('Should fail with a big thumbnail file', async function () { | 368 | it('Should fail with a big thumbnail file', async function () { |
369 | const fields = baseCorrectParams | 369 | const fields = baseCorrectParams |
370 | const attaches = { | 370 | const attaches = { |
371 | 'thumbnailfile': join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), | 371 | thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), |
372 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') | 372 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') |
373 | } | 373 | } |
374 | 374 | ||
375 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 375 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -378,8 +378,8 @@ describe('Test videos API validator', function () { | |||
378 | it('Should fail with an incorrect preview file', async function () { | 378 | it('Should fail with an incorrect preview file', async function () { |
379 | const fields = baseCorrectParams | 379 | const fields = baseCorrectParams |
380 | const attaches = { | 380 | const attaches = { |
381 | 'previewfile': join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), | 381 | previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png'), |
382 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') | 382 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') |
383 | } | 383 | } |
384 | 384 | ||
385 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 385 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -388,8 +388,8 @@ describe('Test videos API validator', function () { | |||
388 | it('Should fail with a big preview file', async function () { | 388 | it('Should fail with a big preview file', async function () { |
389 | const fields = baseCorrectParams | 389 | const fields = baseCorrectParams |
390 | const attaches = { | 390 | const attaches = { |
391 | 'previewfile': join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), | 391 | previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png'), |
392 | 'videofile': join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') | 392 | videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4') |
393 | } | 393 | } |
394 | 394 | ||
395 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 395 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -566,7 +566,7 @@ describe('Test videos API validator', function () { | |||
566 | it('Should fail with an incorrect thumbnail file', async function () { | 566 | it('Should fail with an incorrect thumbnail file', async function () { |
567 | const fields = baseCorrectParams | 567 | const fields = baseCorrectParams |
568 | const attaches = { | 568 | const attaches = { |
569 | 'thumbnailfile': join(root(), 'server', 'tests', 'fixtures', 'avatar.png') | 569 | thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png') |
570 | } | 570 | } |
571 | 571 | ||
572 | await makeUploadRequest({ | 572 | await makeUploadRequest({ |
@@ -582,7 +582,7 @@ describe('Test videos API validator', function () { | |||
582 | it('Should fail with a big thumbnail file', async function () { | 582 | it('Should fail with a big thumbnail file', async function () { |
583 | const fields = baseCorrectParams | 583 | const fields = baseCorrectParams |
584 | const attaches = { | 584 | const attaches = { |
585 | 'thumbnailfile': join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') | 585 | thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') |
586 | } | 586 | } |
587 | 587 | ||
588 | await makeUploadRequest({ | 588 | await makeUploadRequest({ |
@@ -598,7 +598,7 @@ describe('Test videos API validator', function () { | |||
598 | it('Should fail with an incorrect preview file', async function () { | 598 | it('Should fail with an incorrect preview file', async function () { |
599 | const fields = baseCorrectParams | 599 | const fields = baseCorrectParams |
600 | const attaches = { | 600 | const attaches = { |
601 | 'previewfile': join(root(), 'server', 'tests', 'fixtures', 'avatar.png') | 601 | previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar.png') |
602 | } | 602 | } |
603 | 603 | ||
604 | await makeUploadRequest({ | 604 | await makeUploadRequest({ |
@@ -614,7 +614,7 @@ describe('Test videos API validator', function () { | |||
614 | it('Should fail with a big preview file', async function () { | 614 | it('Should fail with a big preview file', async function () { |
615 | const fields = baseCorrectParams | 615 | const fields = baseCorrectParams |
616 | const attaches = { | 616 | const attaches = { |
617 | 'previewfile': join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') | 617 | previewfile: join(root(), 'server', 'tests', 'fixtures', 'avatar-big.png') |
618 | } | 618 | } |
619 | 619 | ||
620 | await makeUploadRequest({ | 620 | await makeUploadRequest({ |