diff options
Diffstat (limited to 'server/tests/api/check-params/custom-pages.ts')
-rw-r--r-- | server/tests/api/check-params/custom-pages.ts | 15 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { | 4 | import { |
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' |
11 | import { makeGetRequest, makePutBodyRequest } from '../../../../shared/extra-utils/requests/requests' | 12 | import { HttpStatusCode } from '@shared/models' |
12 | 13 | ||
13 | describe('Test custom pages validators', function () { | 14 | describe('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 | }) |