diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-29 10:54:27 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-10-29 11:48:21 +0200 |
commit | 3c10840fa90fc88fc98e8169faf4745ff6c80893 (patch) | |
tree | 9a60c4de766700fbc33804b06ec46279b20c855e /server/tests | |
parent | 2760b454a761f6af3138b2fb5f34340772ab0d1e (diff) | |
download | PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.gz PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.zst PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.zip |
Add video file size info in admin videos list
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/videos/videos-common-filters.ts | 28 |
1 files changed, 27 insertions, 1 deletions
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 { | |||
13 | setDefaultVideoChannel, | 13 | setDefaultVideoChannel, |
14 | waitJobs | 14 | waitJobs |
15 | } from '@shared/extra-utils' | 15 | } from '@shared/extra-utils' |
16 | import { HttpStatusCode, UserRole, Video, VideoInclude, VideoPrivacy } from '@shared/models' | 16 | import { HttpStatusCode, UserRole, Video, VideoDetails, VideoInclude, VideoPrivacy } from '@shared/models' |
17 | 17 | ||
18 | describe('Test videos filter', function () { | 18 | describe('Test videos filter', function () { |
19 | let servers: PeerTubeServer[] | 19 | let servers: PeerTubeServer[] |
@@ -365,6 +365,32 @@ describe('Test videos filter', function () { | |||
365 | await servers[0].blocklist.removeFromServerBlocklist({ server: servers[1].host }) | 365 | await servers[0].blocklist.removeFromServerBlocklist({ server: servers[1].host }) |
366 | }) | 366 | }) |
367 | 367 | ||
368 | it('Should include video files', async function () { | ||
369 | for (const path of paths) { | ||
370 | { | ||
371 | const videos = await listVideos({ server: servers[0], path }) | ||
372 | |||
373 | for (const video of videos) { | ||
374 | const videoWithFiles = video as VideoDetails | ||
375 | |||
376 | expect(videoWithFiles.files).to.not.exist | ||
377 | expect(videoWithFiles.streamingPlaylists).to.not.exist | ||
378 | } | ||
379 | } | ||
380 | |||
381 | { | ||
382 | const videos = await listVideos({ server: servers[0], path, include: VideoInclude.FILES }) | ||
383 | |||
384 | for (const video of videos) { | ||
385 | const videoWithFiles = video as VideoDetails | ||
386 | |||
387 | expect(videoWithFiles.files).to.exist | ||
388 | expect(videoWithFiles.files).to.have.length.at.least(1) | ||
389 | } | ||
390 | } | ||
391 | } | ||
392 | }) | ||
393 | |||
368 | it('Should filter by tags and category', async function () { | 394 | it('Should filter by tags and category', async function () { |
369 | await servers[0].videos.upload({ attributes: { name: 'tag filter', tags: [ 'tag1', 'tag2' ] } }) | 395 | await servers[0].videos.upload({ attributes: { name: 'tag filter', tags: [ 'tag1', 'tag2' ] } }) |
370 | await servers[0].videos.upload({ attributes: { name: 'tag filter with category', tags: [ 'tag3' ], category: 4 } }) | 396 | await servers[0].videos.upload({ attributes: { name: 'tag filter with category', tags: [ 'tag3' ], category: 4 } }) |