]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-blacklist.ts
Add ability to share playlists in modal
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-blacklist.ts
index 6e15893f3ac59eba04c64db2f48f7727c90591f9..52cac20d9e9ac0a9dd51a990289a69401ad8dbb3 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
+import 'mocha'
 import * as chai from 'chai'
 import { orderBy } from 'lodash'
-import 'mocha'
 import {
   addVideoToBlacklist,
   cleanupTests,
@@ -25,10 +25,10 @@ import {
 } from '../../../../shared/extra-utils/index'
 import { doubleFollow } from '../../../../shared/extra-utils/server/follows'
 import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
-import { VideoBlocklist, VideoBlockType } from '../../../../shared/models/videos'
-import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
+import { getGoodVideoUrl, getMagnetURI, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
 import { User, UserRole } from '../../../../shared/models/users'
-import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
+import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
+import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
 
 const expect = chai.expect
 
@@ -127,7 +127,7 @@ describe('Test video blacklist', function () {
       const res = await getBlacklistedVideosList({
         url: servers[0].url,
         token: servers[0].accessToken,
-        type: VideoBlockType.MANUAL
+        type: VideoBlacklistType.MANUAL
       })
 
       expect(res.body.total).to.equal(2)
@@ -141,7 +141,7 @@ describe('Test video blacklist', function () {
       const res = await getBlacklistedVideosList({
         url: servers[0].url,
         token: servers[0].accessToken,
-        type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+        type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
       })
 
       expect(res.body.total).to.equal(0)
@@ -219,7 +219,7 @@ describe('Test video blacklist', function () {
   })
 
   describe('When removing a blacklisted video', function () {
-    let videoToRemove: VideoBlocklist
+    let videoToRemove: VideoBlacklist
     let blacklist = []
 
     it('Should not have any video in videos list on server 1', async function () {
@@ -328,7 +328,7 @@ describe('Test video blacklist', function () {
     it('Should have the correct video blacklist unfederate attribute', async function () {
       const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, sort: 'createdAt' })
 
-      const blacklistedVideos: VideoBlocklist[] = res.body.data
+      const blacklistedVideos: VideoBlacklist[] = res.body.data
       const video3Blacklisted = blacklistedVideos.find(b => b.video.uuid === video3UUID)
       const video4Blacklisted = blacklistedVideos.find(b => b.video.uuid === video4UUID)
 
@@ -396,7 +396,7 @@ describe('Test video blacklist', function () {
           url: servers[0].url,
           accessToken: servers[0].accessToken,
           username: user.username,
-          adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK,
+          adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST,
           password: user.password,
           role: UserRole.USER
         })
@@ -413,7 +413,7 @@ describe('Test video blacklist', function () {
       const res = await getBlacklistedVideosList({
         url: servers[0].url,
         token: servers[0].accessToken,
-        type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+        type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
       })
 
       expect(res.body.total).to.equal(1)
@@ -424,7 +424,7 @@ describe('Test video blacklist', function () {
       this.timeout(15000)
 
       const attributes = {
-        targetUrl: getYoutubeVideoUrl(),
+        targetUrl: getGoodVideoUrl(),
         name: 'URL import',
         channelId: channelOfUserWithoutFlag
       }
@@ -434,7 +434,7 @@ describe('Test video blacklist', function () {
         url: servers[0].url,
         token: servers[0].accessToken,
         sort: 'createdAt',
-        type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+        type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
       })
 
       expect(res.body.total).to.equal(2)
@@ -453,7 +453,7 @@ describe('Test video blacklist', function () {
         url: servers[0].url,
         token: servers[0].accessToken,
         sort: 'createdAt',
-        type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+        type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
       })
 
       expect(res.body.total).to.equal(3)
@@ -466,7 +466,7 @@ describe('Test video blacklist', function () {
       const res = await getBlacklistedVideosList({
         url: servers[0].url,
         token: servers[0].accessToken,
-        type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+        type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
       })
 
       expect(res.body.total).to.equal(3)