aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-06-09 16:07:10 +0200
committerRigel Kent <sendmemail@rigelk.eu>2020-06-10 21:12:09 +0200
commit3487330d308166afb542cbacae0475693c0b059e (patch)
tree6a7b6ea3dd105661354bf0df6c6d3f7a7abe64e8 /server/tests/api
parent5baee5fca418487e72ddcd6419d31bca8659b668 (diff)
downloadPeerTube-3487330d308166afb542cbacae0475693c0b059e.tar.gz
PeerTube-3487330d308166afb542cbacae0475693c0b059e.tar.zst
PeerTube-3487330d308166afb542cbacae0475693c0b059e.zip
preserve original variable names server-side
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/users.ts2
-rw-r--r--server/tests/api/check-params/video-blacklist.ts4
-rw-r--r--server/tests/api/users/users.ts4
-rw-r--r--server/tests/api/videos/video-blacklist.ts20
4 files changed, 15 insertions, 15 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index 94d47408a..472fbda43 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -188,7 +188,7 @@ describe('Test users API validators', function () {
188 videoQuota: -1, 188 videoQuota: -1,
189 videoQuotaDaily: -1, 189 videoQuotaDaily: -1,
190 role: UserRole.USER, 190 role: UserRole.USER,
191 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK 191 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
192 } 192 }
193 193
194 it('Should fail with a too small username', async function () { 194 it('Should fail with a too small username', async function () {
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts
index b96c26989..145f43980 100644
--- a/server/tests/api/check-params/video-blacklist.ts
+++ b/server/tests/api/check-params/video-blacklist.ts
@@ -24,7 +24,7 @@ import {
24 checkBadSortPagination, 24 checkBadSortPagination,
25 checkBadStartPagination 25 checkBadStartPagination
26} from '../../../../shared/extra-utils/requests/check-api-params' 26} from '../../../../shared/extra-utils/requests/check-api-params'
27import { VideoBlockType, VideoDetails } from '../../../../shared/models/videos' 27import { VideoBlacklistType, VideoDetails } from '../../../../shared/models/videos'
28import { expect } from 'chai' 28import { expect } from 'chai'
29 29
30describe('Test video blacklist API validators', function () { 30describe('Test video blacklist API validators', function () {
@@ -243,7 +243,7 @@ describe('Test video blacklist API validators', function () {
243 }) 243 })
244 244
245 it('Should succeed with the correct parameters', async function () { 245 it('Should succeed with the correct parameters', async function () {
246 await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlockType.MANUAL }) 246 await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlacklistType.MANUAL })
247 }) 247 })
248 }) 248 })
249 249
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index af5a5fd25..cad954fcb 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -265,7 +265,7 @@ describe('Test users', function () {
265 username: user.username, 265 username: user.username,
266 password: user.password, 266 password: user.password,
267 videoQuota: 2 * 1024 * 1024, 267 videoQuota: 2 * 1024 * 1024,
268 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK 268 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
269 }) 269 })
270 }) 270 })
271 271
@@ -292,7 +292,7 @@ describe('Test users', function () {
292 } 292 }
293 293
294 expect(userMe.adminFlags).to.be.undefined 294 expect(userMe.adminFlags).to.be.undefined
295 expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK) 295 expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)
296 296
297 expect(userMe.specialPlaylists).to.have.lengthOf(1) 297 expect(userMe.specialPlaylists).to.have.lengthOf(1)
298 expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER) 298 expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
diff --git a/server/tests/api/videos/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts
index 6e15893f3..a8500627b 100644
--- a/server/tests/api/videos/video-blacklist.ts
+++ b/server/tests/api/videos/video-blacklist.ts
@@ -25,7 +25,7 @@ import {
25} from '../../../../shared/extra-utils/index' 25} from '../../../../shared/extra-utils/index'
26import { doubleFollow } from '../../../../shared/extra-utils/server/follows' 26import { doubleFollow } from '../../../../shared/extra-utils/server/follows'
27import { waitJobs } from '../../../../shared/extra-utils/server/jobs' 27import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
28import { VideoBlocklist, VideoBlockType } from '../../../../shared/models/videos' 28import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
29import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' 29import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
30import { User, UserRole } from '../../../../shared/models/users' 30import { User, UserRole } from '../../../../shared/models/users'
31import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports' 31import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
@@ -127,7 +127,7 @@ describe('Test video blacklist', function () {
127 const res = await getBlacklistedVideosList({ 127 const res = await getBlacklistedVideosList({
128 url: servers[0].url, 128 url: servers[0].url,
129 token: servers[0].accessToken, 129 token: servers[0].accessToken,
130 type: VideoBlockType.MANUAL 130 type: VideoBlacklistType.MANUAL
131 }) 131 })
132 132
133 expect(res.body.total).to.equal(2) 133 expect(res.body.total).to.equal(2)
@@ -141,7 +141,7 @@ describe('Test video blacklist', function () {
141 const res = await getBlacklistedVideosList({ 141 const res = await getBlacklistedVideosList({
142 url: servers[0].url, 142 url: servers[0].url,
143 token: servers[0].accessToken, 143 token: servers[0].accessToken,
144 type: VideoBlockType.AUTO_BEFORE_PUBLISHED 144 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
145 }) 145 })
146 146
147 expect(res.body.total).to.equal(0) 147 expect(res.body.total).to.equal(0)
@@ -219,7 +219,7 @@ describe('Test video blacklist', function () {
219 }) 219 })
220 220
221 describe('When removing a blacklisted video', function () { 221 describe('When removing a blacklisted video', function () {
222 let videoToRemove: VideoBlocklist 222 let videoToRemove: VideoBlacklist
223 let blacklist = [] 223 let blacklist = []
224 224
225 it('Should not have any video in videos list on server 1', async function () { 225 it('Should not have any video in videos list on server 1', async function () {
@@ -328,7 +328,7 @@ describe('Test video blacklist', function () {
328 it('Should have the correct video blacklist unfederate attribute', async function () { 328 it('Should have the correct video blacklist unfederate attribute', async function () {
329 const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, sort: 'createdAt' }) 329 const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, sort: 'createdAt' })
330 330
331 const blacklistedVideos: VideoBlocklist[] = res.body.data 331 const blacklistedVideos: VideoBlacklist[] = res.body.data
332 const video3Blacklisted = blacklistedVideos.find(b => b.video.uuid === video3UUID) 332 const video3Blacklisted = blacklistedVideos.find(b => b.video.uuid === video3UUID)
333 const video4Blacklisted = blacklistedVideos.find(b => b.video.uuid === video4UUID) 333 const video4Blacklisted = blacklistedVideos.find(b => b.video.uuid === video4UUID)
334 334
@@ -396,7 +396,7 @@ describe('Test video blacklist', function () {
396 url: servers[0].url, 396 url: servers[0].url,
397 accessToken: servers[0].accessToken, 397 accessToken: servers[0].accessToken,
398 username: user.username, 398 username: user.username,
399 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK, 399 adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST,
400 password: user.password, 400 password: user.password,
401 role: UserRole.USER 401 role: UserRole.USER
402 }) 402 })
@@ -413,7 +413,7 @@ describe('Test video blacklist', function () {
413 const res = await getBlacklistedVideosList({ 413 const res = await getBlacklistedVideosList({
414 url: servers[0].url, 414 url: servers[0].url,
415 token: servers[0].accessToken, 415 token: servers[0].accessToken,
416 type: VideoBlockType.AUTO_BEFORE_PUBLISHED 416 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
417 }) 417 })
418 418
419 expect(res.body.total).to.equal(1) 419 expect(res.body.total).to.equal(1)
@@ -434,7 +434,7 @@ describe('Test video blacklist', function () {
434 url: servers[0].url, 434 url: servers[0].url,
435 token: servers[0].accessToken, 435 token: servers[0].accessToken,
436 sort: 'createdAt', 436 sort: 'createdAt',
437 type: VideoBlockType.AUTO_BEFORE_PUBLISHED 437 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
438 }) 438 })
439 439
440 expect(res.body.total).to.equal(2) 440 expect(res.body.total).to.equal(2)
@@ -453,7 +453,7 @@ describe('Test video blacklist', function () {
453 url: servers[0].url, 453 url: servers[0].url,
454 token: servers[0].accessToken, 454 token: servers[0].accessToken,
455 sort: 'createdAt', 455 sort: 'createdAt',
456 type: VideoBlockType.AUTO_BEFORE_PUBLISHED 456 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
457 }) 457 })
458 458
459 expect(res.body.total).to.equal(3) 459 expect(res.body.total).to.equal(3)
@@ -466,7 +466,7 @@ describe('Test video blacklist', function () {
466 const res = await getBlacklistedVideosList({ 466 const res = await getBlacklistedVideosList({
467 url: servers[0].url, 467 url: servers[0].url,
468 token: servers[0].accessToken, 468 token: servers[0].accessToken,
469 type: VideoBlockType.AUTO_BEFORE_PUBLISHED 469 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
470 }) 470 })
471 471
472 expect(res.body.total).to.equal(3) 472 expect(res.body.total).to.equal(3)