mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Fix import tests
This commit is contained in:
parent
eadbf4e001
commit
b45fbf4337
3 changed files with 12 additions and 8 deletions
Binary file not shown.
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
@ -4,7 +4,8 @@ import { CustomConfig, HttpStatusCode, Video, VideoImportState, VideoPrivacy, Vi
|
|||
import { areHttpImportTestsDisabled, areYoutubeImportTestsDisabled } from '@peertube/peertube-node-utils'
|
||||
import {
|
||||
PeerTubeServer,
|
||||
cleanupTests, createMultipleServers,
|
||||
cleanupTests,
|
||||
createMultipleServers,
|
||||
createSingleServer,
|
||||
doubleFollow,
|
||||
getServerImportConfig,
|
||||
|
@ -80,11 +81,9 @@ async function checkVideoServer2 (server: PeerTubeServer, id: number | string) {
|
|||
}
|
||||
|
||||
describe('Test video imports', function () {
|
||||
|
||||
if (areHttpImportTestsDisabled()) return
|
||||
|
||||
function runSuite (mode: 'youtube-dl' | 'yt-dlp') {
|
||||
|
||||
describe('Import ' + mode, function () {
|
||||
let servers: PeerTubeServer[] = []
|
||||
|
||||
|
@ -396,7 +395,12 @@ describe('Test video imports', function () {
|
|||
// test resolution
|
||||
const video = await servers[0].videos.get({ id: videoUUID })
|
||||
expect(video.name).to.equal('hdr video')
|
||||
const maxResolution = Math.max.apply(Math, video.files.map(function (o) { return o.resolution.id }))
|
||||
const maxResolution = Math.max.apply(
|
||||
Math,
|
||||
video.files.map(function (o) {
|
||||
return o.resolution.id
|
||||
})
|
||||
)
|
||||
expect(maxResolution, 'expected max resolution not met').to.equals(VideoResolution.H_240P)
|
||||
})
|
||||
|
||||
|
@ -470,7 +474,7 @@ describe('Test video imports', function () {
|
|||
expect(video.name).to.equal('bigger resolution video')
|
||||
|
||||
expect(video.files).to.have.lengthOf(2)
|
||||
expect(video.files.find(f => f.resolution.id === 240)).to.exist
|
||||
expect(video.files.find(f => f.resolution.id === 320)).to.exist
|
||||
expect(video.files.find(f => f.resolution.id === 144)).to.exist
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue