]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/videos/video-source.ts
5ecf8316f4222898b83217b1744a65a9a12c0466
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-source.ts
1 import { expect } from 'chai'
2 import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
3
4 describe('Test video source', () => {
5 let server: PeerTubeServer = null
6 const fixture = 'video_short.webm'
7
8 before(async function () {
9 this.timeout(30000)
10
11 server = await createSingleServer(1)
12 await setAccessTokensToServers([ server ])
13 })
14
15 it('Should get the source filename with legacy upload', async function () {
16 this.timeout(30000)
17
18 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'legacy' })
19
20 const source = await server.videos.getSource({ id: uuid })
21 expect(source.filename).to.equal(fixture)
22 })
23
24 it('Should get the source filename with resumable upload', async function () {
25 this.timeout(30000)
26
27 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'resumable' })
28
29 const source = await server.videos.getSource({ id: uuid })
30 expect(source.filename).to.equal(fixture)
31 })
32
33 after(async function () {
34 await cleanupTests([ server ])
35 })
36 })