aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r--server/tests/api/check-params/videos.ts12
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
3import 'mocha' 3import { expect } from 'chai'
4import * as chai from 'chai'
5import { omit } from 'lodash'
6import { join } from 'path' 4import { join } from 'path'
7import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared' 5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared'
8import { randomInt, root } from '@shared/core-utils' 6import { omit, randomInt, root } from '@shared/core-utils'
9import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' 7import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
10import { 8import {
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
21const expect = chai.expect
22
23describe('Test videos API validator', function () { 19describe('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)