aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/videos-filter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/videos-filter.ts')
-rw-r--r--server/tests/api/check-params/videos-filter.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/tests/api/check-params/videos-filter.ts b/server/tests/api/check-params/videos-filter.ts
index e4e799cc7..c2c69904f 100644
--- a/server/tests/api/check-params/videos-filter.ts
+++ b/server/tests/api/check-params/videos-filter.ts
@@ -1,6 +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 { HttpStatusCode } from '@shared/models'
4import { 5import {
5 cleanupTests, 6 cleanupTests,
6 createSingleServer, 7 createSingleServer,
@@ -8,11 +9,10 @@ import {
8 PeerTubeServer, 9 PeerTubeServer,
9 setAccessTokensToServers, 10 setAccessTokensToServers,
10 setDefaultVideoChannel 11 setDefaultVideoChannel
11} from '../../../../shared/extra-utils' 12} from '@shared/extra-utils'
12import { UserRole } from '../../../../shared/models/users' 13import { UserRole } from '@shared/models'
13import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
14 14
15async function testEndpoints (server: PeerTubeServer, token: string, filter: string, statusCodeExpected: HttpStatusCode) { 15async function testEndpoints (server: PeerTubeServer, token: string, filter: string, expectedStatus: HttpStatusCode) {
16 const paths = [ 16 const paths = [
17 '/api/v1/video-channels/root_channel/videos', 17 '/api/v1/video-channels/root_channel/videos',
18 '/api/v1/accounts/root/videos', 18 '/api/v1/accounts/root/videos',
@@ -28,7 +28,7 @@ async function testEndpoints (server: PeerTubeServer, token: string, filter: str
28 query: { 28 query: {
29 filter 29 filter
30 }, 30 },
31 statusCodeExpected 31 expectedStatus
32 }) 32 })
33 } 33 }
34} 34}
@@ -89,7 +89,7 @@ describe('Test video filters validators', function () {
89 await makeGetRequest({ 89 await makeGetRequest({
90 url: server.url, 90 url: server.url,
91 path: '/feeds/videos.json', 91 path: '/feeds/videos.json',
92 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401, 92 expectedStatus: HttpStatusCode.UNAUTHORIZED_401,
93 query: { 93 query: {
94 filter 94 filter
95 } 95 }
@@ -101,7 +101,7 @@ describe('Test video filters validators', function () {
101 await makeGetRequest({ 101 await makeGetRequest({
102 url: server.url, 102 url: server.url,
103 path: '/feeds/videos.json', 103 path: '/feeds/videos.json',
104 statusCodeExpected: HttpStatusCode.OK_200, 104 expectedStatus: HttpStatusCode.OK_200,
105 query: { 105 query: {
106 filter: 'local' 106 filter: 'local'
107 } 107 }