2e401e8575
* store uploaded video filename closes #4731 * dont crash if videos channel exist * migration: use raw query * video source: fixes after code review * cleanup * bump migration * updates after code review * refactor: use checkUserCanManageVideo * videoSource: add openapi doc * test(check-params/video-source): fix timeout * Styling * Correctly set original filename as source Co-authored-by: Chocobozzz <me@florianbigard.com>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import 'mocha'
|
|
import * as chai from 'chai'
|
|
import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
|
|
|
|
const expect = chai.expect
|
|
|
|
describe('Test video source', () => {
|
|
let server: PeerTubeServer = null
|
|
const fixture = 'video_short.webm'
|
|
|
|
before(async function () {
|
|
this.timeout(30000)
|
|
|
|
server = await createSingleServer(1)
|
|
await setAccessTokensToServers([ server ])
|
|
})
|
|
|
|
it('Should get the source filename with legacy upload', async function () {
|
|
this.timeout(30000)
|
|
|
|
const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'legacy' })
|
|
|
|
const source = await server.videos.getSource({ id: uuid })
|
|
expect(source.filename).to.equal(fixture)
|
|
})
|
|
|
|
it('Should get the source filename with resumable upload', async function () {
|
|
this.timeout(30000)
|
|
|
|
const { uuid } = await server.videos.upload({ attributes: { name: 'my video', fixture }, mode: 'resumable' })
|
|
|
|
const source = await server.videos.getSource({ id: uuid })
|
|
expect(source.filename).to.equal(fixture)
|
|
})
|
|
|
|
after(async function () {
|
|
await cleanupTests([ server ])
|
|
})
|
|
})
|