1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Add audio upload tests

This commit is contained in:
Chocobozzz 2019-05-17 11:56:12 +02:00
parent 7b992a86b1
commit b345a8047b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
13 changed files with 109 additions and 22 deletions

View file

@ -14,6 +14,7 @@ import {
getMyVideos,
getVideo,
getVideosList,
makeGetRequest,
root,
ServerInfo,
setAccessTokensToServers,
@ -365,6 +366,56 @@ describe('Test video transcoding', function () {
expect(await canDoQuickTranscode(buildAbsoluteFixturePath('video_short.webm'))).to.be.false
})
it('Should merge an audio file with the preview file', async function () {
this.timeout(60000)
const videoAttributesArg = { name: 'audio_with_preview', previewfile: 'preview.jpg', fixture: 'sample.ogg' }
await uploadVideo(servers[ 1 ].url, servers[ 1 ].accessToken, videoAttributesArg)
await waitJobs(servers)
for (const server of servers) {
const res = await getVideosList(server.url)
const video = res.body.data.find(v => v.name === 'audio_with_preview')
const res2 = await getVideo(server.url, video.id)
const videoDetails: VideoDetails = res2.body
expect(videoDetails.files).to.have.lengthOf(1)
await makeGetRequest({ url: server.url, path: videoDetails.thumbnailPath, statusCodeExpected: 200 })
await makeGetRequest({ url: server.url, path: videoDetails.previewPath, statusCodeExpected: 200 })
const magnetUri = videoDetails.files[ 0 ].magnetUri
expect(magnetUri).to.contain('.mp4')
}
})
it('Should upload an audio file and choose a default background image', async function () {
this.timeout(60000)
const videoAttributesArg = { name: 'audio_without_preview', fixture: 'sample.ogg' }
await uploadVideo(servers[ 1 ].url, servers[ 1 ].accessToken, videoAttributesArg)
await waitJobs(servers)
for (const server of servers) {
const res = await getVideosList(server.url)
const video = res.body.data.find(v => v.name === 'audio_without_preview')
const res2 = await getVideo(server.url, video.id)
const videoDetails = res2.body
expect(videoDetails.files).to.have.lengthOf(1)
await makeGetRequest({ url: server.url, path: videoDetails.thumbnailPath, statusCodeExpected: 200 })
await makeGetRequest({ url: server.url, path: videoDetails.previewPath, statusCodeExpected: 200 })
const magnetUri = videoDetails.files[ 0 ].magnetUri
expect(magnetUri).to.contain('.mp4')
}
})
after(async function () {
await cleanupTests(servers)
})