Verified Commit 9a66a4bc authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix tests

parent d15be116
......@@ -19,7 +19,9 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
'action:api.user.created',
'action:api.user.deleted',
'action:api.user.updated',
'action:api.user.oauth2-got-token'
'action:api.user.oauth2-got-token',
'action:api.video-playlist-element.created'
]
for (const h of actionHooks) {
......
......@@ -70,37 +70,8 @@ describe('Test plugin action hooks', function () {
})
})
describe('Playlist hooks', function () {
let playlistId
let videoId
before(async function () {
const { body } = await createVideoPlaylist({
url: servers[0].url,
token: servers[0].accessToken,
playlistAttrs: {
displayName: 'My playlist',
privacy: VideoPlaylistPrivacy.PUBLIC
}
})
playlistId = body.videoPlaylist.id
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'my super name' })
videoId = res.body.video.id
})
it('Should run action:api.video-playlist-element.created', async function () {
await addVideoInPlaylist({
url: servers[0].url,
token: servers[0].accessToken,
playlistId,
elementAttrs: { videoId }
})
await checkHook('action:api.video-playlist-element.created')
})
})
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
......@@ -209,6 +180,41 @@ describe('Test plugin action hooks', function () {
})
})
describe('Playlist hooks', function () {
let playlistId: number
let videoId: number
before(async function () {
{
const res = await createVideoPlaylist({
url: servers[0].url,
token: servers[0].accessToken,
playlistAttrs: {
displayName: 'My playlist',
privacy: VideoPlaylistPrivacy.PRIVATE
}
})
playlistId = res.body.videoPlaylist.id
}
{
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'my super name' })
videoId = res.body.video.id
}
})
it('Should run action:api.video-playlist-element.created', async function () {
await addVideoInPlaylist({
url: servers[0].url,
token: servers[0].accessToken,
playlistId,
elementAttrs: { videoId }
})
await checkHook('action:api.video-playlist-element.created')
})
})
after(async function () {
await cleanupTests(servers)
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment