aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/debug.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 10:42:24 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitc0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch)
treebaf29753ac5d4598643e3bee719f8df0cc36c59d /server/tests/api/check-params/debug.ts
parent08642a765ea514a00f159db898edf14c376fbe6c (diff)
downloadPeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip
Refactor requests
Diffstat (limited to 'server/tests/api/check-params/debug.ts')
-rw-r--r--server/tests/api/check-params/debug.ts17
1 files changed, 5 insertions, 12 deletions
diff --git a/server/tests/api/check-params/debug.ts b/server/tests/api/check-params/debug.ts
index 9c13e9daf..a55786359 100644
--- a/server/tests/api/check-params/debug.ts
+++ b/server/tests/api/check-params/debug.ts
@@ -1,15 +1,8 @@
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'
4 4import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
5import { 5import { HttpStatusCode } from '@shared/models'
6 cleanupTests,
7 createSingleServer,
8 PeerTubeServer,
9 setAccessTokensToServers
10} from '../../../../shared/extra-utils'
11import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
12import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
13 6
14describe('Test debug API validators', function () { 7describe('Test debug API validators', function () {
15 const path = '/api/v1/server/debug' 8 const path = '/api/v1/server/debug'
@@ -39,7 +32,7 @@ describe('Test debug API validators', function () {
39 await makeGetRequest({ 32 await makeGetRequest({
40 url: server.url, 33 url: server.url,
41 path, 34 path,
42 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 35 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
43 }) 36 })
44 }) 37 })
45 38
@@ -48,7 +41,7 @@ describe('Test debug API validators', function () {
48 url: server.url, 41 url: server.url,
49 path, 42 path,
50 token: userAccessToken, 43 token: userAccessToken,
51 statusCodeExpected: HttpStatusCode.FORBIDDEN_403 44 expectedStatus: HttpStatusCode.FORBIDDEN_403
52 }) 45 })
53 }) 46 })
54 47
@@ -58,7 +51,7 @@ describe('Test debug API validators', function () {
58 path, 51 path,
59 token: server.accessToken, 52 token: server.accessToken,
60 query: { startDate: new Date().toISOString() }, 53 query: { startDate: new Date().toISOString() },
61 statusCodeExpected: HttpStatusCode.OK_200 54 expectedStatus: HttpStatusCode.OK_200
62 }) 55 })
63 }) 56 })
64 }) 57 })