1 import { expect } from 'chai'
2 import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
4 describe('Test video source', () => {
5 let server: PeerTubeServer = null
6 const fixture = 'video_short.webm'
8 before(async function () {
11 server = await createSingleServer(1)
12 await setAccessTokensToServers([ server ])
15 it('Should get the source filename with legacy upload', async function () {
18 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'legacy' })
20 const source = await server.videos.getSource({ id: uuid })
21 expect(source.filename).to.equal(fixture)
24 it('Should get the source filename with resumable upload', async function () {
27 const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'resumable' })
29 const source = await server.videos.getSource({ id: uuid })
30 expect(source.filename).to.equal(fixture)
33 after(async function () {
34 await cleanupTests([ server ])