diff options
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r-- | server/tests/api/check-params/videos.ts | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index e5c9b90c4..572ca8997 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -1,11 +1,9 @@ | |||
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 | ||
3 | import 'mocha' | 3 | import { expect } from 'chai' |
4 | import * as chai from 'chai' | ||
5 | import { omit } from 'lodash' | ||
6 | import { join } from 'path' | 4 | import { join } from 'path' |
7 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared' | 5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared' |
8 | import { randomInt, root } from '@shared/core-utils' | 6 | import { omit, randomInt, root } from '@shared/core-utils' |
9 | import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' | 7 | import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' |
10 | import { | 8 | import { |
11 | cleanupTests, | 9 | cleanupTests, |
@@ -18,8 +16,6 @@ import { | |||
18 | setAccessTokensToServers | 16 | setAccessTokensToServers |
19 | } from '@shared/server-commands' | 17 | } from '@shared/server-commands' |
20 | 18 | ||
21 | const expect = chai.expect | ||
22 | |||
23 | describe('Test videos API validator', function () { | 19 | describe('Test videos API validator', function () { |
24 | const path = '/api/v1/videos/' | 20 | const path = '/api/v1/videos/' |
25 | let server: PeerTubeServer | 21 | let server: PeerTubeServer |
@@ -219,7 +215,7 @@ describe('Test videos API validator', function () { | |||
219 | }) | 215 | }) |
220 | 216 | ||
221 | it('Should fail without name', async function () { | 217 | it('Should fail without name', async function () { |
222 | const fields = omit(baseCorrectParams, 'name') | 218 | const fields = omit(baseCorrectParams, [ 'name' ]) |
223 | const attaches = baseCorrectAttaches | 219 | const attaches = baseCorrectAttaches |
224 | 220 | ||
225 | await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode) | 221 | await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode) |
@@ -268,7 +264,7 @@ describe('Test videos API validator', function () { | |||
268 | }) | 264 | }) |
269 | 265 | ||
270 | it('Should fail without a channel', async function () { | 266 | it('Should fail without a channel', async function () { |
271 | const fields = omit(baseCorrectParams, 'channelId') | 267 | const fields = omit(baseCorrectParams, [ 'channelId' ]) |
272 | const attaches = baseCorrectAttaches | 268 | const attaches = baseCorrectAttaches |
273 | 269 | ||
274 | await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode) | 270 | await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode) |