]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/videos-common-filters.ts
shared/ typescript types dir server-commands
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / videos-common-filters.ts
index 4f22d4ac327394f8fafe4aeac93e1443bc39752b..0254662c5429d81360e1f8709206cc8886d52963 100644 (file)
@@ -12,7 +12,7 @@ import {
   setAccessTokensToServers,
   setDefaultVideoChannel,
   waitJobs
-} from '@shared/extra-utils'
+} from '@shared/server-commands'
 import { HttpStatusCode, UserRole, Video, VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models'
 
 describe('Test videos filter', function () {
@@ -138,6 +138,7 @@ describe('Test videos filter', function () {
       hasWebtorrentFiles?: boolean
       hasHLSFiles?: boolean
       include?: VideoInclude
+      privacyOneOf?: VideoPrivacy[]
       category?: number
       tagsAllOf?: string[]
       token?: string
@@ -148,7 +149,7 @@ describe('Test videos filter', function () {
         path: options.path,
         token: options.token ?? options.server.accessToken,
         query: {
-          ...pick(options, [ 'isLocal', 'include', 'category', 'tagsAllOf', 'hasWebtorrentFiles', 'hasHLSFiles' ]),
+          ...pick(options, [ 'isLocal', 'include', 'category', 'tagsAllOf', 'hasWebtorrentFiles', 'hasHLSFiles', 'privacyOneOf' ]),
 
           sort: 'createdAt'
         },
@@ -162,6 +163,7 @@ describe('Test videos filter', function () {
       server: PeerTubeServer
       isLocal?: boolean
       include?: VideoInclude
+      privacyOneOf?: VideoPrivacy[]
       token?: string
       expectedStatus?: HttpStatusCode
     }) {
@@ -195,7 +197,7 @@ describe('Test videos filter', function () {
             server,
             token,
             isLocal: true,
-            include: VideoInclude.HIDDEN_PRIVACY
+            privacyOneOf: [ VideoPrivacy.UNLISTED, VideoPrivacy.PUBLIC, VideoPrivacy.PRIVATE ]
           })
 
           for (const names of namesResults) {
@@ -216,7 +218,7 @@ describe('Test videos filter', function () {
           const [ channelVideos, accountVideos, videos, searchVideos ] = await getVideosNames({
             server,
             token,
-            include: VideoInclude.HIDDEN_PRIVACY
+            privacyOneOf: [ VideoPrivacy.UNLISTED, VideoPrivacy.PUBLIC, VideoPrivacy.PRIVATE ]
           })
 
           expect(channelVideos).to.have.lengthOf(3)