aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/custom-pages.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/custom-pages.ts
parent08642a765ea514a00f159db898edf14c376fbe6c (diff)
downloadPeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip
Refactor requests
Diffstat (limited to 'server/tests/api/check-params/custom-pages.ts')
-rw-r--r--server/tests/api/check-params/custom-pages.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/tests/api/check-params/custom-pages.ts b/server/tests/api/check-params/custom-pages.ts
index 043505e32..9fbbea315 100644
--- a/server/tests/api/check-params/custom-pages.ts
+++ b/server/tests/api/check-params/custom-pages.ts
@@ -1,14 +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 { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
5import { 4import {
6 cleanupTests, 5 cleanupTests,
7 createSingleServer, 6 createSingleServer,
7 makeGetRequest,
8 makePutBodyRequest,
8 PeerTubeServer, 9 PeerTubeServer,
9 setAccessTokensToServers 10 setAccessTokensToServers
10} from '../../../../shared/extra-utils' 11} from '@shared/extra-utils'
11import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-utils/requests/requests' 12import { HttpStatusCode } from '@shared/models'
12 13
13describe('Test custom pages validators', function () { 14describe('Test custom pages validators', function () {
14 const path = '/api/v1/custom-pages/homepage/instance' 15 const path = '/api/v1/custom-pages/homepage/instance'
@@ -37,7 +38,7 @@ describe('Test custom pages validators', function () {
37 url: server.url, 38 url: server.url,
38 path, 39 path,
39 fields: { content: 'super content' }, 40 fields: { content: 'super content' },
40 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 41 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
41 }) 42 })
42 }) 43 })
43 44
@@ -47,7 +48,7 @@ describe('Test custom pages validators', function () {
47 path, 48 path,
48 token: userAccessToken, 49 token: userAccessToken,
49 fields: { content: 'super content' }, 50 fields: { content: 'super content' },
50 statusCodeExpected: HttpStatusCode.FORBIDDEN_403 51 expectedStatus: HttpStatusCode.FORBIDDEN_403
51 }) 52 })
52 }) 53 })
53 54
@@ -57,7 +58,7 @@ describe('Test custom pages validators', function () {
57 path, 58 path,
58 token: server.accessToken, 59 token: server.accessToken,
59 fields: { content: 'super content' }, 60 fields: { content: 'super content' },
60 statusCodeExpected: HttpStatusCode.NO_CONTENT_204 61 expectedStatus: HttpStatusCode.NO_CONTENT_204
61 }) 62 })
62 }) 63 })
63 }) 64 })
@@ -68,7 +69,7 @@ describe('Test custom pages validators', function () {
68 await makeGetRequest({ 69 await makeGetRequest({
69 url: server.url, 70 url: server.url,
70 path, 71 path,
71 statusCodeExpected: HttpStatusCode.OK_200 72 expectedStatus: HttpStatusCode.OK_200
72 }) 73 })
73 }) 74 })
74 }) 75 })