aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/audio-only.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-15 10:02:54 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch)
treeda82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/videos/audio-only.ts
parent7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff)
downloadPeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip
Introduce videos command
Diffstat (limited to 'server/tests/api/videos/audio-only.ts')
-rw-r--r--server/tests/api/videos/audio-only.ts20
1 files changed, 4 insertions, 16 deletions
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts
index 9b516af81..e31905b36 100644
--- a/server/tests/api/videos/audio-only.ts
+++ b/server/tests/api/videos/audio-only.ts
@@ -4,17 +4,7 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' 6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils'
7import { 7import { cleanupTests, doubleFollow, flushAndRunMultipleServers, ServerInfo, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
8 cleanupTests,
9 doubleFollow,
10 flushAndRunMultipleServers,
11 getVideo,
12 ServerInfo,
13 setAccessTokensToServers,
14 uploadVideo,
15 waitJobs
16} from '../../../../shared/extra-utils'
17import { VideoDetails } from '../../../../shared/models/videos'
18 8
19const expect = chai.expect 9const expect = chai.expect
20 10
@@ -58,15 +48,13 @@ describe('Test audio only video transcoding', function () {
58 it('Should upload a video and transcode it', async function () { 48 it('Should upload a video and transcode it', async function () {
59 this.timeout(120000) 49 this.timeout(120000)
60 50
61 const resUpload = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'audio only' }) 51 const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'audio only' } })
62 videoUUID = resUpload.body.video.uuid 52 videoUUID = uuid
63 53
64 await waitJobs(servers) 54 await waitJobs(servers)
65 55
66 for (const server of servers) { 56 for (const server of servers) {
67 const res = await getVideo(server.url, videoUUID) 57 const video = await server.videosCommand.get({ id: videoUUID })
68 const video: VideoDetails = res.body
69
70 expect(video.streamingPlaylists).to.have.lengthOf(1) 58 expect(video.streamingPlaylists).to.have.lengthOf(1)
71 59
72 for (const files of [ video.files, video.streamingPlaylists[0].files ]) { 60 for (const files of [ video.files, video.streamingPlaylists[0].files ]) {