checkVideoFilesWereRemoved,
cleanupTests,
completeVideoCheck,
- flushAndRunServer,
- ServerInfo,
+ createSingleServer,
+ PeerTubeServer,
setAccessTokensToServers,
testImage,
wait
describe('Test a single server', function () {
function runSuite (mode: 'legacy' | 'resumable') {
- let server: ServerInfo = null
+ let server: PeerTubeServer = null
let videoId: number | string
let videoId2: string
let videoUUID = ''
before(async function () {
this.timeout(30000)
- server = await flushAndRunServer(1)
+ server = await createSingleServer(1)
await setAccessTokensToServers([ server ])
})
})
it('Should remove the video', async function () {
+ const video = await server.videos.get({ id: videoId })
await server.videos.remove({ id: videoId })
- await checkVideoFilesWereRemoved(videoUUID, server)
+ await checkVideoFilesWereRemoved({ video, server })
})
it('Should not have videos', async function () {
await server.videos.update({ id: videoId, attributes })
})
- it('Should filter by tags and category', async function () {
- {
- const { data, total } = await server.videos.list({ tagsAllOf: [ 'tagup1', 'tagup2' ], categoryOneOf: [ 4 ] })
- expect(total).to.equal(1)
- expect(data[0].name).to.equal('my super video updated')
- }
-
- {
- const { total } = await server.videos.list({ tagsAllOf: [ 'tagup1', 'tagup2' ], categoryOneOf: [ 3 ] })
- expect(total).to.equal(0)
- }
- })
-
it('Should have the video updated', async function () {
this.timeout(60000)