diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 10:42:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch) | |
tree | baf29753ac5d4598643e3bee719f8df0cc36c59d /server/tests/api/check-params/bulk.ts | |
parent | 08642a765ea514a00f159db898edf14c376fbe6c (diff) | |
download | PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip |
Refactor requests
Diffstat (limited to 'server/tests/api/check-params/bulk.ts')
-rw-r--r-- | server/tests/api/check-params/bulk.ts | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/server/tests/api/check-params/bulk.ts b/server/tests/api/check-params/bulk.ts index a660c3d80..bc9d7784d 100644 --- a/server/tests/api/check-params/bulk.ts +++ b/server/tests/api/check-params/bulk.ts | |||
@@ -1,14 +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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { | 4 | import { cleanupTests, createSingleServer, makePostBodyRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' |
5 | cleanupTests, | 5 | import { HttpStatusCode } from '@shared/models' |
6 | createSingleServer, | ||
7 | PeerTubeServer, | ||
8 | setAccessTokensToServers | ||
9 | } from '../../../../shared/extra-utils' | ||
10 | import { makePostBodyRequest } from '../../../../shared/extra-utils/requests/requests' | ||
11 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
12 | 6 | ||
13 | describe('Test bulk API validators', function () { | 7 | describe('Test bulk API validators', function () { |
14 | let server: PeerTubeServer | 8 | let server: PeerTubeServer |
@@ -36,7 +30,7 @@ describe('Test bulk API validators', function () { | |||
36 | url: server.url, | 30 | url: server.url, |
37 | path, | 31 | path, |
38 | fields: { accountName: 'user1', scope: 'my-videos' }, | 32 | fields: { accountName: 'user1', scope: 'my-videos' }, |
39 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 | 33 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 |
40 | }) | 34 | }) |
41 | }) | 35 | }) |
42 | 36 | ||
@@ -46,7 +40,7 @@ describe('Test bulk API validators', function () { | |||
46 | token: server.accessToken, | 40 | token: server.accessToken, |
47 | path, | 41 | path, |
48 | fields: { accountName: 'user2', scope: 'my-videos' }, | 42 | fields: { accountName: 'user2', scope: 'my-videos' }, |
49 | statusCodeExpected: HttpStatusCode.NOT_FOUND_404 | 43 | expectedStatus: HttpStatusCode.NOT_FOUND_404 |
50 | }) | 44 | }) |
51 | }) | 45 | }) |
52 | 46 | ||
@@ -56,7 +50,7 @@ describe('Test bulk API validators', function () { | |||
56 | token: server.accessToken, | 50 | token: server.accessToken, |
57 | path, | 51 | path, |
58 | fields: { accountName: 'user1', scope: 'my-videoss' }, | 52 | fields: { accountName: 'user1', scope: 'my-videoss' }, |
59 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 | 53 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
60 | }) | 54 | }) |
61 | }) | 55 | }) |
62 | 56 | ||
@@ -66,7 +60,7 @@ describe('Test bulk API validators', function () { | |||
66 | token: userAccessToken, | 60 | token: userAccessToken, |
67 | path, | 61 | path, |
68 | fields: { accountName: 'user1', scope: 'instance' }, | 62 | fields: { accountName: 'user1', scope: 'instance' }, |
69 | statusCodeExpected: HttpStatusCode.FORBIDDEN_403 | 63 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
70 | }) | 64 | }) |
71 | }) | 65 | }) |
72 | 66 | ||
@@ -76,7 +70,7 @@ describe('Test bulk API validators', function () { | |||
76 | token: server.accessToken, | 70 | token: server.accessToken, |
77 | path, | 71 | path, |
78 | fields: { accountName: 'user1', scope: 'instance' }, | 72 | fields: { accountName: 'user1', scope: 'instance' }, |
79 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | 73 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
80 | }) | 74 | }) |
81 | }) | 75 | }) |
82 | }) | 76 | }) |