]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/api/videos/video-source.ts
Add sync youtube playlist test
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-source.ts
CommitLineData
86347717 1import { expect } from 'chai'
2e401e85 2import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
3
2e401e85 4describe('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})