diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-17 11:58:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-17 12:24:03 +0100 |
commit | c55e3d7227fe1453869e309025996b9d75256d5d (patch) | |
tree | 08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/tests/api/check-params | |
parent | bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff) | |
download | PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip |
Move test functions outside extra-utils
Diffstat (limited to 'server/tests/api/check-params')
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
18 | import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models' | ||
19 | 17 | ||
20 | describe('Test abuses API validators', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' |
5 | checkBadCountPagination, | ||
6 | checkBadSortPagination, | ||
7 | checkBadStartPagination, | ||
8 | cleanupTests, | ||
9 | createSingleServer, | ||
10 | PeerTubeServer | ||
11 | } from '@shared/server-commands' | ||
12 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, PeerTubeServer } from '@shared/server-commands' | ||
13 | 7 | ||
14 | describe('Test accounts API validators', function () { | 8 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { HttpStatusCode } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
17 | import { HttpStatusCode } from '@shared/models' | ||
18 | 16 | ||
19 | describe('Test blocklist API validators', function () { | 17 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { MockSmtpServer } from '@server/tests/shared' | ||
4 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 6 | import { 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 | ||
14 | describe('Test contact form API validators', function () { | 8 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { HttpStatusCode } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
16 | import { HttpStatusCode } from '@shared/models' | ||
17 | 15 | ||
18 | describe('Test server follows API validators', function () { | 16 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { 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' | ||
14 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
15 | 7 | ||
16 | describe('Test jobs API validators', function () { | 8 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
6 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
5 | import { | 7 | import { |
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' |
17 | import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
18 | 18 | ||
19 | describe('Test video lives API validator', function () { | 19 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared' | ||
5 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
6 | import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models' | ||
4 | import { | 7 | import { |
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' |
19 | import { HttpStatusCode, UserRole, VideoCreateResult } from '@shared/models' | ||
20 | 17 | ||
21 | describe('Test my user API validators', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
16 | import { HttpStatusCode, PeerTubePlugin, PluginType } from '@shared/models' | ||
17 | 15 | ||
18 | describe('Test server plugins API validators', function () { | 16 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
19 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
20 | 18 | ||
21 | describe('Test server redundancy API validators', function () { | 19 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { 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' | ||
14 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
15 | 7 | ||
16 | function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { | 8 | function 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | ||
5 | import { HttpStatusCode, UserRole } from '@shared/models' | 4 | import { HttpStatusCode, UserRole } from '@shared/models' |
5 | import { | ||
6 | cleanupTests, | ||
7 | createMultipleServers, | ||
8 | doubleFollow, | ||
9 | PeerTubeServer, | ||
10 | setAccessTokensToServers, | ||
11 | waitJobs | ||
12 | } from '@shared/server-commands' | ||
6 | 13 | ||
7 | describe('Test transcoding API validators', function () { | 14 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { FIXTURE_URLS } from '@server/tests/shared' | ||
5 | import { randomInt } from '@shared/core-utils' | 6 | import { randomInt } from '@shared/core-utils' |
7 | import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models' | ||
6 | import { | 8 | import { |
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' |
16 | import { HttpStatusCode, VideoImportState, VideoPrivacy } from '@shared/models' | ||
17 | 17 | ||
18 | describe('Test upload quota', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { io } from 'socket.io-client' | 4 | import { io } from 'socket.io-client' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
6 | import { wait } from '@shared/core-utils' | ||
7 | import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' | ||
5 | import { | 8 | import { |
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' |
18 | import { HttpStatusCode, UserNotificationSetting, UserNotificationSettingValue } from '@shared/models' | ||
19 | 17 | ||
20 | describe('Test user notifications API validators', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { |
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' |
17 | import { HttpStatusCode } from '@shared/models' | 14 | import { HttpStatusCode } from '@shared/models' |
15 | import { checkBadStartPagination, checkBadCountPagination, checkBadSortPagination } from '@server/tests/shared' | ||
18 | 16 | ||
19 | describe('Test user subscriptions API validators', function () { | 17 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, MockSmtpServer } from '@server/tests/shared' | ||
6 | import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models' | ||
5 | import { | 7 | import { |
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' |
19 | import { HttpStatusCode, UserAdminFlag, UserRole } from '@shared/models' | ||
20 | 17 | ||
21 | describe('Test users admin API validators', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { | 5 | import { MockSmtpServer } from '@server/tests/shared' |
6 | cleanupTests, | ||
7 | createSingleServer, | ||
8 | makePostBodyRequest, | ||
9 | MockSmtpServer, | ||
10 | PeerTubeServer, | ||
11 | setAccessTokensToServers | ||
12 | } from '@shared/server-commands' | ||
13 | import { HttpStatusCode, UserRole } from '@shared/models' | 6 | import { HttpStatusCode, UserRole } from '@shared/models' |
7 | import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' | ||
14 | 8 | ||
15 | describe('Test users API validators', function () { | 9 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
6 | import { HttpStatusCode, VideoBlacklistType } from '@shared/models' | ||
5 | import { | 7 | import { |
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' |
19 | import { HttpStatusCode, VideoBlacklistType } from '@shared/models' | ||
20 | 18 | ||
21 | describe('Test video blacklist API validators', function () { | 19 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
5 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
14 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
15 | 15 | ||
16 | describe('Test video captions API validator', function () { | 16 | describe('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 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
7 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
8 | import { HttpStatusCode, VideoChannelUpdate } from '@shared/models' | ||
6 | import { | 9 | import { |
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' |
21 | import { HttpStatusCode, VideoChannelUpdate } from '@shared/models' | ||
22 | 20 | ||
23 | const expect = chai.expect | 21 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' | ||
6 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
5 | import { | 7 | import { |
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' |
17 | import { HttpStatusCode, VideoCreateResult } from '@shared/models' | ||
18 | 16 | ||
19 | const expect = chai.expect | 17 | const 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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands' | ||
5 | import { HttpStatusCode, UserRole } from '@shared/models' | 4 | import { HttpStatusCode, UserRole } from '@shared/models' |
5 | import { | ||
6 | cleanupTests, | ||
7 | createMultipleServers, | ||
8 | doubleFollow, | ||
9 | PeerTubeServer, | ||
10 | setAccessTokensToServers, | ||
11 | waitJobs | ||
12 | } from '@shared/server-commands' | ||
6 | 13 | ||
7 | describe('Test videos files', function () { | 14 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, FIXTURE_URLS } from '@server/tests/shared' | ||
6 | import { buildAbsoluteFixturePath } from '@shared/core-utils' | ||
7 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | ||
5 | import { | 8 | import { |
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' |
19 | import { HttpStatusCode, VideoPrivacy } from '@shared/models' | ||
20 | 17 | ||
21 | describe('Test video imports API validator', function () { | 18 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { 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' | ||
16 | import { | 5 | import { |
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' |
15 | import { | ||
16 | cleanupTests, | ||
17 | createSingleServer, | ||
18 | makeGetRequest, | ||
19 | PeerTubeServer, | ||
20 | PlaylistsCommand, | ||
21 | setAccessTokensToServers, | ||
22 | setDefaultVideoChannel | ||
23 | } from '@shared/server-commands' | ||
26 | 24 | ||
27 | describe('Test video playlists API validator', function () { | 25 | describe('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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { checkBadCountPagination, checkBadStartPagination } from '@server/tests/shared' | ||
5 | import { HttpStatusCode } from '@shared/models' | ||
4 | import { | 6 | import { |
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' |
15 | import { HttpStatusCode } from '@shared/models' | ||
16 | 15 | ||
17 | describe('Test videos history API validator', function () { | 16 | describe('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' | |||
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { omit } from 'lodash' | 5 | import { omit } from 'lodash' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { randomInt } from '@shared/core-utils' | 7 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination, checkUploadVideoParam } from '@server/tests/shared' |
8 | import { randomInt, root } from '@shared/core-utils' | ||
9 | import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
8 | import { | 10 | import { |
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' |
23 | import { HttpStatusCode, PeerTubeProblemDocument, VideoCreateResult, VideoPrivacy } from '@shared/models' | ||
24 | 20 | ||
25 | const expect = chai.expect | 21 | const expect = chai.expect |
26 | 22 | ||