X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-create-transcoding.ts;h=dcdbd9c6ed74caa8ce519c9f28b1e75836a53158;hb=0f11ec8dd32b50897c18588db948e96cf0fc2c70;hp=62a6bab0d6c288c03c2a56b2dde3523878796dde;hpb=c55e3d7227fe1453869e309025996b9d75256d5d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-create-transcoding.ts b/server/tests/api/videos/video-create-transcoding.ts index 62a6bab0d..dcdbd9c6e 100644 --- a/server/tests/api/videos/video-create-transcoding.ts +++ b/server/tests/api/videos/video-create-transcoding.ts @@ -25,7 +25,11 @@ async function checkFilesInObjectStorage (video: VideoDetails) { await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) } - for (const file of video.streamingPlaylists[0].files) { + const streamingPlaylistFiles = video.streamingPlaylists.length === 0 + ? [] + : video.streamingPlaylists[0].files + + for (const file of streamingPlaylistFiles) { expectStartWith(file.fileUrl, ObjectStorageCommand.getPlaylistBaseUrl()) await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200) } @@ -127,6 +131,25 @@ function runTests (objectStorage: boolean) { } }) + it('Should only generate WebTorrent', async function () { + this.timeout(60000) + + await servers[0].videos.removeHLSFiles({ videoId: videoUUID }) + await waitJobs(servers) + + await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) + await waitJobs(servers) + + for (const server of servers) { + const videoDetails = await server.videos.get({ id: videoUUID }) + + expect(videoDetails.files).to.have.lengthOf(5) + expect(videoDetails.streamingPlaylists).to.have.lengthOf(0) + + if (objectStorage) await checkFilesInObjectStorage(videoDetails) + } + }) + it('Should not have updated published at attributes', async function () { const video = await servers[0].videos.get({ id: videoUUID })