1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Introduce videos command

This commit is contained in:
Chocobozzz 2021-07-15 10:02:54 +02:00
parent 7926c5f9b3
commit d23dd9fbfc
No known key found for this signature in database
GPG key ID: 583A612D890159BE
108 changed files with 2484 additions and 3100 deletions

View file

@ -9,10 +9,7 @@ import {
reRunServer,
ServerInfo,
setAccessTokensToServers,
setDefaultVideoChannel,
updateVideo,
uploadVideo,
viewVideo
setDefaultVideoChannel
} from '@shared/extra-utils'
import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
@ -52,20 +49,20 @@ describe('Test plugin action hooks', function () {
describe('Videos hooks', function () {
it('Should run action:api.video.uploaded', async function () {
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' })
videoUUID = res.body.video.uuid
const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video' } })
videoUUID = uuid
await checkHook('action:api.video.uploaded')
})
it('Should run action:api.video.updated', async function () {
await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, { name: 'video updated' })
await servers[0].videosCommand.update({ id: videoUUID, attributes: { name: 'video updated' } })
await checkHook('action:api.video.updated')
})
it('Should run action:api.video.viewed', async function () {
await viewVideo(servers[0].url, videoUUID)
await servers[0].videosCommand.view({ id: videoUUID })
await checkHook('action:api.video.viewed')
})
@ -170,8 +167,8 @@ describe('Test plugin action hooks', function () {
}
{
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'my super name' })
videoId = res.body.video.id
const { id } = await servers[0].videosCommand.upload({ attributes: { name: 'my super name' } })
videoId = id
}
})