From 527a52ac4295a072927ff46761766a8b181a7603 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 12 Nov 2021 14:19:56 +0100 Subject: Add ability to filter out public videos from admin --- server/tests/api/videos/videos-common-filters.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/tests/api/videos/videos-common-filters.ts') diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts index 4f22d4ac3..ca5f42173 100644 --- a/server/tests/api/videos/videos-common-filters.ts +++ b/server/tests/api/videos/videos-common-filters.ts @@ -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) -- cgit v1.2.3