aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-17 11:58:15 +0100
committerChocobozzz <me@florianbigard.com>2021-12-17 12:24:03 +0100
commitc55e3d7227fe1453869e309025996b9d75256d5d (patch)
tree08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/tests/api/check-params
parentbf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff)
downloadPeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz
PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst
PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip
Move test functions outside extra-utils
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/abuses.ts6
-rw-r--r--server/tests/api/check-params/accounts.ts10
-rw-r--r--server/tests/api/check-params/blocklist.ts6
-rw-r--r--server/tests/api/check-params/contact-form.ts10
-rw-r--r--server/tests/api/check-params/follows.ts6
-rw-r--r--server/tests/api/check-params/jobs.ts12
-rw-r--r--server/tests/api/check-params/live.ts4
-rw-r--r--server/tests/api/check-params/my-user.ts9
-rw-r--r--server/tests/api/check-params/plugins.ts6
-rw-r--r--server/tests/api/check-params/redundancy.ts6
-rw-r--r--server/tests/api/check-params/search.ts12
-rw-r--r--server/tests/api/check-params/transcoding.ts9
-rw-r--r--server/tests/api/check-params/upload-quota.ts4
-rw-r--r--server/tests/api/check-params/user-notifications.ts10
-rw-r--r--server/tests/api/check-params/user-subscriptions.ts4
-rw-r--r--server/tests/api/check-params/users-admin.ts7
-rw-r--r--server/tests/api/check-params/users.ts10
-rw-r--r--server/tests/api/check-params/video-blacklist.ts6
-rw-r--r--server/tests/api/check-params/video-captions.ts4
-rw-r--r--server/tests/api/check-params/video-channels.ts8
-rw-r--r--server/tests/api/check-params/video-comments.ts6
-rw-r--r--server/tests/api/check-params/video-files.ts9
-rw-r--r--server/tests/api/check-params/video-imports.ts9
-rw-r--r--server/tests/api/check-params/video-playlists.ts22
-rw-r--r--server/tests/api/check-params/videos-history.ts5
-rw-r--r--server/tests/api/check-params/videos.ts10
26 files changed, 77 insertions, 133 deletions
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts
index 58167cbab..c4b051723 100644
--- a/server/tests/api/check-params/abuses.ts
+++ b/server/tests/api/check-params/abuses.ts
@@ -1,11 +1,10 @@
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 { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
4import { 6import {
5 AbusesCommand, 7 AbusesCommand,
6 checkBadCountPagination,
7 checkBadSortPagination,
8 checkBadStartPagination,
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
11 doubleFollow, 10 doubleFollow,
@@ -15,7 +14,6 @@ import {
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 waitJobs 15 waitJobs
17} from '@shared/server-commands' 16} from '@shared/server-commands'
18import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
19 17
20describe('Test abuses API validators', function () { 18describe('Test abuses API validators', function () {
21 const basePath = '/api/v1/abuses/' 19 const basePath = '/api/v1/abuses/'
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index fc8e63ed4..07f879e0e 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -1,15 +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 'mocha'
4import { 4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests,
9 createSingleServer,
10 PeerTubeServer
11} from '@shared/server-commands'
12import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands'
13 7
14describe('Test accounts API validators', function () { 8describe('Test accounts API validators', function () {
15 const path = '/api/v1/accounts/' 9 const path = '/api/v1/accounts/'
diff --git a/server/tests/api/check-params/blocklist.ts b/server/tests/api/check-params/blocklist.ts
index 2dc3a166d..36526d494 100644
--- a/server/tests/api/check-params/blocklist.ts
+++ b/server/tests/api/check-params/blocklist.ts
@@ -1,10 +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 'mocha'
4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5import { HttpStatusCode } from '@shared/models'
4import { 6import {
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests, 7 cleanupTests,
9 createMultipleServers, 8 createMultipleServers,
10 doubleFollow, 9 doubleFollow,
@@ -14,7 +13,6 @@ import {
14 PeerTubeServer, 13 PeerTubeServer,
15 setAccessTokensToServers 14 setAccessTokensToServers
16} from '@shared/server-commands' 15} from '@shared/server-commands'
17import { HttpStatusCode } from '@shared/models'
18 16
19describe('Test blocklist API validators', function () { 17describe('Test blocklist API validators', function () {
20 let servers: PeerTubeServer[] 18 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/contact-form.ts b/server/tests/api/check-params/contact-form.ts
index a2e51e14d..9db442b0b 100644
--- a/server/tests/api/check-params/contact-form.ts
+++ b/server/tests/api/check-params/contact-form.ts
@@ -1,15 +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 'mocha'
4import { MockSmtpServer } from '@server/tests/shared'
4import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
5import { 6import { cleanupTests, ContactFormCommand, createSingleServer, killallServers, PeerTubeServer } from '@shared/server-commands'
6 cleanupTests,
7 ContactFormCommand,
8 createSingleServer,
9 killallServers,
10 MockSmtpServer,
11 PeerTubeServer
12} from '@shared/server-commands'
13 7
14describe('Test contact form API validators', function () { 8describe('Test contact form API validators', function () {
15 let server: PeerTubeServer 9 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts
index 6121d2202..d4dae5a75 100644
--- a/server/tests/api/check-params/follows.ts
+++ b/server/tests/api/check-params/follows.ts
@@ -1,10 +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 'mocha'
4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5import { HttpStatusCode } from '@shared/models'
4import { 6import {
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests, 7 cleanupTests,
9 createSingleServer, 8 createSingleServer,
10 makeDeleteRequest, 9 makeDeleteRequest,
@@ -13,7 +12,6 @@ import {
13 PeerTubeServer, 12 PeerTubeServer,
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '@shared/server-commands' 14} from '@shared/server-commands'
16import { HttpStatusCode } from '@shared/models'
17 15
18describe('Test server follows API validators', function () { 16describe('Test server follows API validators', function () {
19 let server: PeerTubeServer 17 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/jobs.ts b/server/tests/api/check-params/jobs.ts
index b7c603755..d85961d62 100644
--- a/server/tests/api/check-params/jobs.ts
+++ b/server/tests/api/check-params/jobs.ts
@@ -1,17 +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 'mocha'
4import { 4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests,
9 createSingleServer,
10 makeGetRequest,
11 PeerTubeServer,
12 setAccessTokensToServers
13} from '@shared/server-commands'
14import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
15 7
16describe('Test jobs API validators', function () { 8describe('Test jobs API validators', function () {
17 const path = '/api/v1/jobs/failed' 9 const path = '/api/v1/jobs/failed'
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts
index 8b79d97e0..8aee6164c 100644
--- a/server/tests/api/check-params/live.ts
+++ b/server/tests/api/check-params/live.ts
@@ -2,8 +2,9 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { buildAbsoluteFixturePath } from '@shared/core-utils'
6import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
5import { 7import {
6 buildAbsoluteFixturePath,
7 cleanupTests, 8 cleanupTests,
8 createSingleServer, 9 createSingleServer,
9 LiveCommand, 10 LiveCommand,
@@ -14,7 +15,6 @@ import {
14 setAccessTokensToServers, 15 setAccessTokensToServers,
15 stopFfmpeg 16 stopFfmpeg
16} from '@shared/server-commands' 17} from '@shared/server-commands'
17import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
18 18
19describe('Test video lives API validator', function () { 19describe('Test video lives API validator', function () {
20 const path = '/api/v1/videos/live' 20 const path = '/api/v1/videos/live'
diff --git a/server/tests/api/check-params/my-user.ts b/server/tests/api/check-params/my-user.ts
index c8ac71476..95f2122ae 100644
--- a/server/tests/api/check-params/my-user.ts
+++ b/server/tests/api/check-params/my-user.ts
@@ -1,22 +1,19 @@
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 { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared'
5import { buildAbsoluteFixturePath } from '@shared/core-utils'
6import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models'
4import { 7import {
5 buildAbsoluteFixturePath,
6 checkBadCountPagination,
7 checkBadSortPagination,
8 checkBadStartPagination,
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
11 makeGetRequest, 10 makeGetRequest,
12 makePutBodyRequest, 11 makePutBodyRequest,
13 makeUploadRequest, 12 makeUploadRequest,
14 MockSmtpServer,
15 PeerTubeServer, 13 PeerTubeServer,
16 setAccessTokensToServers, 14 setAccessTokensToServers,
17 UsersCommand 15 UsersCommand
18} from '@shared/server-commands' 16} from '@shared/server-commands'
19import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models'
20 17
21describe('Test my user API validators', function () { 18describe('Test my user API validators', function () {
22 const path = '/api/v1/users/' 19 const path = '/api/v1/users/'
diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts
index 79e487590..c3f15b86e 100644
--- a/server/tests/api/check-params/plugins.ts
+++ b/server/tests/api/check-params/plugins.ts
@@ -1,10 +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 'mocha'
4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'
4import { 6import {
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests, 7 cleanupTests,
9 createSingleServer, 8 createSingleServer,
10 makeGetRequest, 9 makeGetRequest,
@@ -13,7 +12,6 @@ import {
13 PeerTubeServer, 12 PeerTubeServer,
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '@shared/server-commands' 14} from '@shared/server-commands'
16import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models'
17 15
18describe('Test server plugins API validators', function () { 16describe('Test server plugins API validators', function () {
19 let server: PeerTubeServer 17 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/redundancy.ts b/server/tests/api/check-params/redundancy.ts
index f3bfcb16c..04519cf23 100644
--- a/server/tests/api/check-params/redundancy.ts
+++ b/server/tests/api/check-params/redundancy.ts
@@ -1,10 +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 'mocha'
4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5import { HttpStatusCode, VideoCreateResult } from '@shared/models'
4import { 6import {
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests, 7 cleanupTests,
9 createMultipleServers, 8 createMultipleServers,
10 doubleFollow, 9 doubleFollow,
@@ -16,7 +15,6 @@ import {
16 setAccessTokensToServers, 15 setAccessTokensToServers,
17 waitJobs 16 waitJobs
18} from '@shared/server-commands' 17} from '@shared/server-commands'
19import { HttpStatusCode, VideoCreateResult } from '@shared/models'
20 18
21describe('Test server redundancy API validators', function () { 19describe('Test server redundancy API validators', function () {
22 let servers: PeerTubeServer[] 20 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts
index edeeed571..ca0fbf31d 100644
--- a/server/tests/api/check-params/search.ts
+++ b/server/tests/api/check-params/search.ts
@@ -1,17 +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 'mocha'
4import { 4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests,
9 createSingleServer,
10 makeGetRequest,
11 PeerTubeServer,
12 setAccessTokensToServers
13} from '@shared/server-commands'
14import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
6import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
15 7
16function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { 8function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) {
17 return server.config.updateCustomSubConfig({ 9 return server.config.updateCustomSubConfig({
diff --git a/server/tests/api/check-params/transcoding.ts b/server/tests/api/check-params/transcoding.ts
index 11ade9071..333012940 100644
--- a/server/tests/api/check-params/transcoding.ts
+++ b/server/tests/api/check-params/transcoding.ts
@@ -1,8 +1,15 @@
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 { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
5import { HttpStatusCode, UserRole } from '@shared/models' 4import { HttpStatusCode, UserRole } from '@shared/models'
5import {
6 cleanupTests,
7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer,
10 setAccessTokensToServers,
11 waitJobs
12} from '@shared/server-commands'
6 13
7describe('Test transcoding API validators', function () { 14describe('Test transcoding API validators', function () {
8 let servers: PeerTubeServer[] 15 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.ts
index 02898bb87..deb4a7aa3 100644
--- a/server/tests/api/check-params/upload-quota.ts
+++ b/server/tests/api/check-params/upload-quota.ts
@@ -2,18 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { FIXTURE_URLS } from '@server/tests/shared'
5import { randomInt } from '@shared/core-utils' 6import { randomInt } from '@shared/core-utils'
7import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models'
6import { 8import {
7 cleanupTests, 9 cleanupTests,
8 createSingleServer, 10 createSingleServer,
9 FIXTURE_URLS,
10 PeerTubeServer, 11 PeerTubeServer,
11 setAccessTokensToServers, 12 setAccessTokensToServers,
12 setDefaultVideoChannel, 13 setDefaultVideoChannel,
13 VideosCommand, 14 VideosCommand,
14 waitJobs 15 waitJobs
15} from '@shared/server-commands' 16} from '@shared/server-commands'
16import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models'
17 17
18describe('Test upload quota', function () { 18describe('Test upload quota', function () {
19 let server: PeerTubeServer 19 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 912d4a992..4bc8084a1 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -2,20 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import { io } from 'socket.io-client' 4import { io } from 'socket.io-client'
5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
6import { wait } from '@shared/core-utils'
7import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
5import { 8import {
6 checkBadCountPagination,
7 checkBadSortPagination,
8 checkBadStartPagination,
9 cleanupTests, 9 cleanupTests,
10 createSingleServer, 10 createSingleServer,
11 makeGetRequest, 11 makeGetRequest,
12 makePostBodyRequest, 12 makePostBodyRequest,
13 makePutBodyRequest, 13 makePutBodyRequest,
14 PeerTubeServer, 14 PeerTubeServer,
15 setAccessTokensToServers, 15 setAccessTokensToServers
16 wait
17} from '@shared/server-commands' 16} from '@shared/server-commands'
18import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
19 17
20describe('Test user notifications API validators', function () { 18describe('Test user notifications API validators', function () {
21 let server: PeerTubeServer 19 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts
index 95226dff5..a13ed5aa3 100644
--- a/server/tests/api/check-params/user-subscriptions.ts
+++ b/server/tests/api/check-params/user-subscriptions.ts
@@ -2,9 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { 4import {
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests, 5 cleanupTests,
9 createSingleServer, 6 createSingleServer,
10 makeDeleteRequest, 7 makeDeleteRequest,
@@ -15,6 +12,7 @@ import {
15 waitJobs 12 waitJobs
16} from '@shared/server-commands' 13} from '@shared/server-commands'
17import { HttpStatusCode } from '@shared/models' 14import { HttpStatusCode } from '@shared/models'
15import { checkBadStartPagination, checkBadCountPagination, checkBadSortPagination } from '@server/tests/shared'
18 16
19describe('Test user subscriptions API validators', function () { 17describe('Test user subscriptions API validators', function () {
20 const path = '/api/v1/users/me/subscriptions' 18 const path = '/api/v1/users/me/subscriptions'
diff --git a/server/tests/api/check-params/users-admin.ts b/server/tests/api/check-params/users-admin.ts
index c98b5e189..d8353f83b 100644
--- a/server/tests/api/check-params/users-admin.ts
+++ b/server/tests/api/check-params/users-admin.ts
@@ -2,21 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared'
6import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
5import { 7import {
6 checkBadCountPagination,
7 checkBadSortPagination,
8 checkBadStartPagination,
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
11 killallServers, 10 killallServers,
12 makeGetRequest, 11 makeGetRequest,
13 makePostBodyRequest, 12 makePostBodyRequest,
14 makePutBodyRequest, 13 makePutBodyRequest,
15 MockSmtpServer,
16 PeerTubeServer, 14 PeerTubeServer,
17 setAccessTokensToServers 15 setAccessTokensToServers
18} from '@shared/server-commands' 16} from '@shared/server-commands'
19import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models'
20 17
21describe('Test users admin API validators', function () { 18describe('Test users admin API validators', function () {
22 const path = '/api/v1/users/' 19 const path = '/api/v1/users/'
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 254177afd..84254945c 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -2,15 +2,9 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { 5import { MockSmtpServer } from '@server/tests/shared'
6 cleanupTests,
7 createSingleServer,
8 makePostBodyRequest,
9 MockSmtpServer,
10 PeerTubeServer,
11 setAccessTokensToServers
12} from '@shared/server-commands'
13import { HttpStatusCode, UserRole } from '@shared/models' 6import { HttpStatusCode, UserRole } from '@shared/models'
7import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
14 8
15describe('Test users API validators', function () { 9describe('Test users API validators', function () {
16 const path = '/api/v1/users/' 10 const path = '/api/v1/users/'
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index 7eb3c1cae..1aab60826 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -2,11 +2,10 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
6import { HttpStatusCode, VideoBlacklistType } from '@shared/models'
5import { 7import {
6 BlacklistCommand, 8 BlacklistCommand,
7 checkBadCountPagination,
8 checkBadSortPagination,
9 checkBadStartPagination,
10 cleanupTests, 9 cleanupTests,
11 createMultipleServers, 10 createMultipleServers,
12 doubleFollow, 11 doubleFollow,
@@ -16,7 +15,6 @@ import {
16 setAccessTokensToServers, 15 setAccessTokensToServers,
17 waitJobs 16 waitJobs
18} from '@shared/server-commands' 17} from '@shared/server-commands'
19import { HttpStatusCode, VideoBlacklistType } from '@shared/models'
20 18
21describe('Test video blacklist API validators', function () { 19describe('Test video blacklist API validators', function () {
22 let servers: PeerTubeServer[] 20 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts
index 34c1a9673..8a8840793 100644
--- a/server/tests/api/check-params/video-captions.ts
+++ b/server/tests/api/check-params/video-captions.ts
@@ -1,8 +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 'mocha'
4import { buildAbsoluteFixturePath } from '@shared/core-utils'
5import { HttpStatusCode, VideoCreateResult } from '@shared/models'
4import { 6import {
5 buildAbsoluteFixturePath,
6 cleanupTests, 7 cleanupTests,
7 createSingleServer, 8 createSingleServer,
8 makeDeleteRequest, 9 makeDeleteRequest,
@@ -11,7 +12,6 @@ import {
11 PeerTubeServer, 12 PeerTubeServer,
12 setAccessTokensToServers 13 setAccessTokensToServers
13} from '@shared/server-commands' 14} from '@shared/server-commands'
14import { HttpStatusCode, VideoCreateResult } from '@shared/models'
15 15
16describe('Test video captions API validator', function () { 16describe('Test video captions API validator', function () {
17 const path = '/api/v1/videos/' 17 const path = '/api/v1/videos/'
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 747a5d3ec..1e9732fe9 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -3,12 +3,11 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
7import { buildAbsoluteFixturePath } from '@shared/core-utils'
8import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
6import { 9import {
7 buildAbsoluteFixturePath,
8 ChannelsCommand, 10 ChannelsCommand,
9 checkBadCountPagination,
10 checkBadSortPagination,
11 checkBadStartPagination,
12 cleanupTests, 11 cleanupTests,
13 createSingleServer, 12 createSingleServer,
14 makeGetRequest, 13 makeGetRequest,
@@ -18,7 +17,6 @@ import {
18 PeerTubeServer, 17 PeerTubeServer,
19 setAccessTokensToServers 18 setAccessTokensToServers
20} from '@shared/server-commands' 19} from '@shared/server-commands'
21import { HttpStatusCode, VideoChannelUpdate } from '@shared/models'
22 20
23const expect = chai.expect 21const expect = chai.expect
24 22
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index 05cf61cba..63c3582e9 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -2,10 +2,9 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
6import { HttpStatusCode, VideoCreateResult } from '@shared/models'
5import { 7import {
6 checkBadCountPagination,
7 checkBadSortPagination,
8 checkBadStartPagination,
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
11 makeDeleteRequest, 10 makeDeleteRequest,
@@ -14,7 +13,6 @@ import {
14 PeerTubeServer, 13 PeerTubeServer,
15 setAccessTokensToServers 14 setAccessTokensToServers
16} from '@shared/server-commands' 15} from '@shared/server-commands'
17import { HttpStatusCode, VideoCreateResult } from '@shared/models'
18 16
19const expect = chai.expect 17const expect = chai.expect
20 18
diff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.ts
index 90ab4460c..8c0795092 100644
--- a/server/tests/api/check-params/video-files.ts
+++ b/server/tests/api/check-params/video-files.ts
@@ -1,8 +1,15 @@
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 { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
5import { HttpStatusCode, UserRole } from '@shared/models' 4import { HttpStatusCode, UserRole } from '@shared/models'
5import {
6 cleanupTests,
7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer,
10 setAccessTokensToServers,
11 waitJobs
12} from '@shared/server-commands'
6 13
7describe('Test videos files', function () { 14describe('Test videos files', function () {
8 let servers: PeerTubeServer[] 15 let servers: PeerTubeServer[]
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index 7cefb2a54..ddea68db4 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -2,21 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared'
6import { buildAbsoluteFixturePath } from '@shared/core-utils'
7import { HttpStatusCode, VideoPrivacy } from '@shared/models'
5import { 8import {
6 buildAbsoluteFixturePath,
7 checkBadCountPagination,
8 checkBadSortPagination,
9 checkBadStartPagination,
10 cleanupTests, 9 cleanupTests,
11 createSingleServer, 10 createSingleServer,
12 FIXTURE_URLS,
13 makeGetRequest, 11 makeGetRequest,
14 makePostBodyRequest, 12 makePostBodyRequest,
15 makeUploadRequest, 13 makeUploadRequest,
16 PeerTubeServer, 14 PeerTubeServer,
17 setAccessTokensToServers 15 setAccessTokensToServers
18} from '@shared/server-commands' 16} from '@shared/server-commands'
19import { HttpStatusCode, VideoPrivacy } from '@shared/models'
20 17
21describe('Test video imports API validator', function () { 18describe('Test video imports API validator', function () {
22 const path = '/api/v1/videos/imports' 19 const path = '/api/v1/videos/imports'
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts
index ac3c13f78..4b17ce7db 100644
--- a/server/tests/api/check-params/video-playlists.ts
+++ b/server/tests/api/check-params/video-playlists.ts
@@ -1,18 +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 { 4import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
5 checkBadCountPagination,
6 checkBadSortPagination,
7 checkBadStartPagination,
8 cleanupTests,
9 createSingleServer,
10 makeGetRequest,
11 PeerTubeServer,
12 PlaylistsCommand,
13 setAccessTokensToServers,
14 setDefaultVideoChannel
15} from '@shared/server-commands'
16import { 5import {
17 HttpStatusCode, 6 HttpStatusCode,
18 VideoPlaylistCreate, 7 VideoPlaylistCreate,
@@ -23,6 +12,15 @@ import {
23 VideoPlaylistReorder, 12 VideoPlaylistReorder,
24 VideoPlaylistType 13 VideoPlaylistType
25} from '@shared/models' 14} from '@shared/models'
15import {
16 cleanupTests,
17 createSingleServer,
18 makeGetRequest,
19 PeerTubeServer,
20 PlaylistsCommand,
21 setAccessTokensToServers,
22 setDefaultVideoChannel
23} from '@shared/server-commands'
26 24
27describe('Test video playlists API validator', function () { 25describe('Test video playlists API validator', function () {
28 let server: PeerTubeServer 26 let server: PeerTubeServer
diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts
index e4b4c4b2a..31a0752c7 100644
--- a/server/tests/api/check-params/videos-history.ts
+++ b/server/tests/api/check-params/videos-history.ts
@@ -1,9 +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 'mocha'
4import { checkBadCountPagination, checkBadStartPagination } from '@server/tests/shared'
5import { HttpStatusCode } from '@shared/models'
4import { 6import {
5 checkBadCountPagination,
6 checkBadStartPagination,
7 cleanupTests, 7 cleanupTests,
8 createSingleServer, 8 createSingleServer,
9 makeGetRequest, 9 makeGetRequest,
@@ -12,7 +12,6 @@ import {
12 PeerTubeServer, 12 PeerTubeServer,
13 setAccessTokensToServers 13 setAccessTokensToServers
14} from '@shared/server-commands' 14} from '@shared/server-commands'
15import { HttpStatusCode } from '@shared/models'
16 15
17describe('Test videos history API validator', function () { 16describe('Test videos history API validator', function () {
18 const myHistoryPath = '/api/v1/users/me/history/videos' 17 const myHistoryPath = '/api/v1/users/me/history/videos'
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index 3b2607eed..4cc70f5cc 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -4,12 +4,10 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { join } from 'path' 6import { join } from 'path'
7import { randomInt } from '@shared/core-utils' 7import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared'
8import { randomInt, root } from '@shared/core-utils'
9import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
8import { 10import {
9 checkBadCountPagination,
10 checkBadSortPagination,
11 checkBadStartPagination,
12 checkUploadVideoParam,
13 cleanupTests, 11 cleanupTests,
14 createSingleServer, 12 createSingleServer,
15 makeDeleteRequest, 13 makeDeleteRequest,
@@ -17,10 +15,8 @@ import {
17 makePutBodyRequest, 15 makePutBodyRequest,
18 makeUploadRequest, 16 makeUploadRequest,
19 PeerTubeServer, 17 PeerTubeServer,
20 root,
21 setAccessTokensToServers 18 setAccessTokensToServers
22} from '@shared/server-commands' 19} from '@shared/server-commands'
23import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models'
24 20
25const expect = chai.expect 21const expect = chai.expect
26 22