aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/action-hooks.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 15:54:39 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commite6346d59e63135cf012ed18c102d3b0179ef565f (patch)
treee65259adb50daa6376c9878abeef051d99191328 /server/tests/plugins/action-hooks.ts
parent72cbfc5695ec5ebdb9721d3648218f63feeaeac5 (diff)
downloadPeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.gz
PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.zst
PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.zip
Introduce playlist command
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r--server/tests/plugins/action-hooks.ts17
1 files changed, 4 insertions, 13 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts
index 5e9dc3515..fd83bf2ac 100644
--- a/server/tests/plugins/action-hooks.ts
+++ b/server/tests/plugins/action-hooks.ts
@@ -5,10 +5,8 @@ import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/mode
5import { 5import {
6 addVideoCommentReply, 6 addVideoCommentReply,
7 addVideoCommentThread, 7 addVideoCommentThread,
8 addVideoInPlaylist,
9 blockUser, 8 blockUser,
10 createUser, 9 createUser,
11 createVideoPlaylist,
12 deleteVideoComment, 10 deleteVideoComment,
13 PluginsCommand, 11 PluginsCommand,
14 registerUser, 12 registerUser,
@@ -180,15 +178,13 @@ describe('Test plugin action hooks', function () {
180 178
181 before(async function () { 179 before(async function () {
182 { 180 {
183 const res = await createVideoPlaylist({ 181 const { id } = await servers[0].playlistsCommand.create({
184 url: servers[0].url, 182 attributes: {
185 token: servers[0].accessToken,
186 playlistAttrs: {
187 displayName: 'My playlist', 183 displayName: 'My playlist',
188 privacy: VideoPlaylistPrivacy.PRIVATE 184 privacy: VideoPlaylistPrivacy.PRIVATE
189 } 185 }
190 }) 186 })
191 playlistId = res.body.videoPlaylist.id 187 playlistId = id
192 } 188 }
193 189
194 { 190 {
@@ -198,12 +194,7 @@ describe('Test plugin action hooks', function () {
198 }) 194 })
199 195
200 it('Should run action:api.video-playlist-element.created', async function () { 196 it('Should run action:api.video-playlist-element.created', async function () {
201 await addVideoInPlaylist({ 197 await servers[0].playlistsCommand.addElement({ playlistId, attributes: { videoId } })
202 url: servers[0].url,
203 token: servers[0].accessToken,
204 playlistId,
205 elementAttrs: { videoId }
206 })
207 198
208 await checkHook('action:api.video-playlist-element.created') 199 await checkHook('action:api.video-playlist-element.created')
209 }) 200 })