aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/action-hooks.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-03 11:17:57 +0200
committerChocobozzz <me@florianbigard.com>2022-08-03 11:24:42 +0200
commit0260dc8aca952f9412a8620e433b9e16e675696e (patch)
tree6f3e6dde7242a4f61aff99fd4c35b4e7f5076314 /server/tests/plugins/action-hooks.ts
parent9ca0f688e9e8558233f1a538b96a43da44e35353 (diff)
downloadPeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.gz
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.tar.zst
PeerTube-0260dc8aca952f9412a8620e433b9e16e675696e.zip
Add channel server hooks
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r--server/tests/plugins/action-hooks.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts
index 57ede2701..209db95a4 100644
--- a/server/tests/plugins/action-hooks.ts
+++ b/server/tests/plugins/action-hooks.ts
@@ -65,6 +65,39 @@ describe('Test plugin action hooks', function () {
65 65
66 await checkHook('action:api.video.viewed') 66 await checkHook('action:api.video.viewed')
67 }) 67 })
68
69 it('Should run action:api.video.deleted', async function () {
70 await servers[0].videos.remove({ id: videoUUID })
71
72 await checkHook('action:api.video.deleted')
73 })
74
75 after(async function () {
76 const { uuid } = await servers[0].videos.quickUpload({ name: 'video' })
77 videoUUID = uuid
78 })
79 })
80
81 describe('Video channel hooks', function () {
82 const channelName = 'my_super_channel'
83
84 it('Should run action:api.video-channel.created', async function () {
85 await servers[0].channels.create({ attributes: { name: channelName } })
86
87 await checkHook('action:api.video-channel.created')
88 })
89
90 it('Should run action:api.video-channel.updated', async function () {
91 await servers[0].channels.update({ channelName, attributes: { displayName: 'my display name' } })
92
93 await checkHook('action:api.video-channel.updated')
94 })
95
96 it('Should run action:api.video-channel.deleted', async function () {
97 await servers[0].channels.delete({ channelName })
98
99 await checkHook('action:api.video-channel.deleted')
100 })
68 }) 101 })
69 102
70 describe('Live hooks', function () { 103 describe('Live hooks', function () {