From 3c10840fa90fc88fc98e8169faf4745ff6c80893 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Oct 2021 10:54:27 +0200 Subject: Add video file size info in admin videos list --- server/tests/api/videos/videos-common-filters.ts | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'server/tests/api') diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts index eb2d2ab50..03c5c3b3f 100644 --- a/server/tests/api/videos/videos-common-filters.ts +++ b/server/tests/api/videos/videos-common-filters.ts @@ -13,7 +13,7 @@ import { setDefaultVideoChannel, waitJobs } from '@shared/extra-utils' -import { HttpStatusCode, UserRole, Video, VideoInclude, VideoPrivacy } from '@shared/models' +import { HttpStatusCode, UserRole, Video, VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models' describe('Test videos filter', function () { let servers: PeerTubeServer[] @@ -365,6 +365,32 @@ describe('Test videos filter', function () { await servers[0].blocklist.removeFromServerBlocklist({ server: servers[1].host }) }) + it('Should include video files', async function () { + for (const path of paths) { + { + const videos = await listVideos({ server: servers[0], path }) + + for (const video of videos) { + const videoWithFiles = video as VideoDetails + + expect(videoWithFiles.files).to.not.exist + expect(videoWithFiles.streamingPlaylists).to.not.exist + } + } + + { + const videos = await listVideos({ server: servers[0], path, include: VideoInclude.FILES }) + + for (const video of videos) { + const videoWithFiles = video as VideoDetails + + expect(videoWithFiles.files).to.exist + expect(videoWithFiles.files).to.have.length.at.least(1) + } + } + } + }) + it('Should filter by tags and category', async function () { await servers[0].videos.upload({ attributes: { name: 'tag filter', tags: [ 'tag1', 'tag2' ] } }) await servers[0].videos.upload({ attributes: { name: 'tag filter with category', tags: [ 'tag3' ], category: 4 } }) -- cgit v1.2.3