aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-channels.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/video-channels.ts
parent08642a765ea514a00f159db898edf14c376fbe6c (diff)
downloadPeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip
Refactor requests
Diffstat (limited to 'server/tests/api/check-params/video-channels.ts')
-rw-r--r--server/tests/api/check-params/video-channels.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 62b8fa4f6..bbe42e43d 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -3,7 +3,7 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { HttpStatusCode } from '@shared/core-utils' 6import { HttpStatusCode } from '@shared/models'
7import { 7import {
8 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
9 ChannelsCommand, 9 ChannelsCommand,
@@ -88,7 +88,7 @@ describe('Test video channels API validator', function () {
88 await makeGetRequest({ 88 await makeGetRequest({
89 url: server.url, 89 url: server.url,
90 path: accountChannelPath, 90 path: accountChannelPath,
91 statusCodeExpected: HttpStatusCode.OK_200 91 expectedStatus: HttpStatusCode.OK_200
92 }) 92 })
93 }) 93 })
94 }) 94 })
@@ -107,7 +107,7 @@ describe('Test video channels API validator', function () {
107 path: videoChannelPath, 107 path: videoChannelPath,
108 token: 'none', 108 token: 'none',
109 fields: baseCorrectParams, 109 fields: baseCorrectParams,
110 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 110 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
111 }) 111 })
112 }) 112 })
113 113
@@ -152,7 +152,7 @@ describe('Test video channels API validator', function () {
152 path: videoChannelPath, 152 path: videoChannelPath,
153 token: server.accessToken, 153 token: server.accessToken,
154 fields: baseCorrectParams, 154 fields: baseCorrectParams,
155 statusCodeExpected: HttpStatusCode.OK_200 155 expectedStatus: HttpStatusCode.OK_200
156 }) 156 })
157 }) 157 })
158 158
@@ -162,7 +162,7 @@ describe('Test video channels API validator', function () {
162 path: videoChannelPath, 162 path: videoChannelPath,
163 token: server.accessToken, 163 token: server.accessToken,
164 fields: baseCorrectParams, 164 fields: baseCorrectParams,
165 statusCodeExpected: HttpStatusCode.CONFLICT_409 165 expectedStatus: HttpStatusCode.CONFLICT_409
166 }) 166 })
167 }) 167 })
168 }) 168 })
@@ -186,7 +186,7 @@ describe('Test video channels API validator', function () {
186 path, 186 path,
187 token: 'hi', 187 token: 'hi',
188 fields: baseCorrectParams, 188 fields: baseCorrectParams,
189 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 189 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
190 }) 190 })
191 }) 191 })
192 192
@@ -196,7 +196,7 @@ describe('Test video channels API validator', function () {
196 path, 196 path,
197 token: accessTokenUser, 197 token: accessTokenUser,
198 fields: baseCorrectParams, 198 fields: baseCorrectParams,
199 statusCodeExpected: HttpStatusCode.FORBIDDEN_403 199 expectedStatus: HttpStatusCode.FORBIDDEN_403
200 }) 200 })
201 }) 201 })
202 202
@@ -226,7 +226,7 @@ describe('Test video channels API validator', function () {
226 path, 226 path,
227 token: server.accessToken, 227 token: server.accessToken,
228 fields: baseCorrectParams, 228 fields: baseCorrectParams,
229 statusCodeExpected: HttpStatusCode.NO_CONTENT_204 229 expectedStatus: HttpStatusCode.NO_CONTENT_204
230 }) 230 })
231 }) 231 })
232 }) 232 })
@@ -271,7 +271,7 @@ describe('Test video channels API validator', function () {
271 path: `${path}/${type}/pick`, 271 path: `${path}/${type}/pick`,
272 fields, 272 fields,
273 attaches, 273 attaches,
274 statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 274 expectedStatus: HttpStatusCode.UNAUTHORIZED_401
275 }) 275 })
276 } 276 }
277 }) 277 })
@@ -288,7 +288,7 @@ describe('Test video channels API validator', function () {
288 token: server.accessToken, 288 token: server.accessToken,
289 fields, 289 fields,
290 attaches, 290 attaches,
291 statusCodeExpected: HttpStatusCode.OK_200 291 expectedStatus: HttpStatusCode.OK_200
292 }) 292 })
293 } 293 }
294 }) 294 })
@@ -299,7 +299,7 @@ describe('Test video channels API validator', function () {
299 const res = await makeGetRequest({ 299 const res = await makeGetRequest({
300 url: server.url, 300 url: server.url,
301 path: videoChannelPath, 301 path: videoChannelPath,
302 statusCodeExpected: HttpStatusCode.OK_200 302 expectedStatus: HttpStatusCode.OK_200
303 }) 303 })
304 304
305 expect(res.body.data).to.be.an('array') 305 expect(res.body.data).to.be.an('array')
@@ -309,7 +309,7 @@ describe('Test video channels API validator', function () {
309 await makeGetRequest({ 309 await makeGetRequest({
310 url: server.url, 310 url: server.url,
311 path: videoChannelPath + '/super_channel2', 311 path: videoChannelPath + '/super_channel2',
312 statusCodeExpected: HttpStatusCode.NOT_FOUND_404 312 expectedStatus: HttpStatusCode.NOT_FOUND_404
313 }) 313 })
314 }) 314 })
315 315
@@ -317,7 +317,7 @@ describe('Test video channels API validator', function () {
317 await makeGetRequest({ 317 await makeGetRequest({
318 url: server.url, 318 url: server.url,
319 path: videoChannelPath + '/super_channel', 319 path: videoChannelPath + '/super_channel',
320 statusCodeExpected: HttpStatusCode.OK_200 320 expectedStatus: HttpStatusCode.OK_200
321 }) 321 })
322 }) 322 })
323 }) 323 })