diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/users.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/video-blacklist.ts | 4 | ||||
-rw-r--r-- | server/tests/api/users/users.ts | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-blacklist.ts | 20 |
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 6e737af15..94d47408a 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.BY_PASS_VIDEO_AUTO_BLACKLIST | 191 | adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK |
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 145f43980..b96c26989 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' |
27 | import { VideoBlacklistType, VideoDetails } from '../../../../shared/models/videos' | 27 | import { VideoBlockType, VideoDetails } from '../../../../shared/models/videos' |
28 | import { expect } from 'chai' | 28 | import { expect } from 'chai' |
29 | 29 | ||
30 | describe('Test video blacklist API validators', function () { | 30 | describe('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: VideoBlacklistType.MANUAL }) | 246 | await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlockType.MANUAL }) |
247 | }) | 247 | }) |
248 | }) | 248 | }) |
249 | 249 | ||
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index c0cbce360..af5a5fd25 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.BY_PASS_VIDEO_AUTO_BLACKLIST | 268 | adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK |
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.BY_PASS_VIDEO_AUTO_BLACKLIST) | 295 | expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK) |
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 67bc0114c..6e15893f3 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' |
26 | import { doubleFollow } from '../../../../shared/extra-utils/server/follows' | 26 | import { doubleFollow } from '../../../../shared/extra-utils/server/follows' |
27 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 27 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
28 | import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos' | 28 | import { VideoBlocklist, VideoBlockType } from '../../../../shared/models/videos' |
29 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' | 29 | import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' |
30 | import { User, UserRole } from '../../../../shared/models/users' | 30 | import { User, UserRole } from '../../../../shared/models/users' |
31 | import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports' | 31 | import { 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: VideoBlacklistType.MANUAL | 130 | type: VideoBlockType.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: VideoBlacklistType.AUTO_BEFORE_PUBLISHED | 144 | type: VideoBlockType.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: VideoBlacklist | 222 | let videoToRemove: VideoBlocklist |
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: VideoBlacklist[] = res.body.data | 331 | const blacklistedVideos: VideoBlocklist[] = 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.BY_PASS_VIDEO_AUTO_BLACKLIST, | 399 | adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK, |
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: VideoBlacklistType.AUTO_BEFORE_PUBLISHED | 416 | type: VideoBlockType.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: VideoBlacklistType.AUTO_BEFORE_PUBLISHED | 437 | type: VideoBlockType.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: VideoBlacklistType.AUTO_BEFORE_PUBLISHED | 456 | type: VideoBlockType.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: VideoBlacklistType.AUTO_BEFORE_PUBLISHED | 469 | type: VideoBlockType.AUTO_BEFORE_PUBLISHED |
470 | }) | 470 | }) |
471 | 471 | ||
472 | expect(res.body.total).to.equal(3) | 472 | expect(res.body.total).to.equal(3) |