aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/action-hooks.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-03-16 10:36:33 +0100
committerChocobozzz <me@florianbigard.com>2023-03-16 10:36:33 +0100
commitc3441b0320f632e22318261bcd614d10187de22d (patch)
treee5273fa7d232d52169f59d17a8aa5f6a908c8ed1 /server/tests/plugins/action-hooks.ts
parent30f939c4b785e8cf2ad829a86f4b2f5892c2fda8 (diff)
downloadPeerTube-c3441b0320f632e22318261bcd614d10187de22d.tar.gz
PeerTube-c3441b0320f632e22318261bcd614d10187de22d.tar.zst
PeerTube-c3441b0320f632e22318261bcd614d10187de22d.zip
Add video AP hooks
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r--server/tests/plugins/action-hooks.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts
index a266ae7f1..98228f79d 100644
--- a/server/tests/plugins/action-hooks.ts
+++ b/server/tests/plugins/action-hooks.ts
@@ -4,6 +4,7 @@ import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/mode
4import { 4import {
5 cleanupTests, 5 cleanupTests,
6 createMultipleServers, 6 createMultipleServers,
7 doubleFollow,
7 killallServers, 8 killallServers,
8 PeerTubeServer, 9 PeerTubeServer,
9 PluginsCommand, 10 PluginsCommand,
@@ -36,6 +37,8 @@ describe('Test plugin action hooks', function () {
36 enabled: true 37 enabled: true
37 } 38 }
38 }) 39 })
40
41 await doubleFollow(servers[0], servers[1])
39 }) 42 })
40 43
41 describe('Application hooks', function () { 44 describe('Application hooks', function () {
@@ -231,6 +234,27 @@ describe('Test plugin action hooks', function () {
231 }) 234 })
232 }) 235 })
233 236
237 describe('Activity Pub hooks', function () {
238 let videoUUID: string
239
240 it('Should run action:activity-pub.remote-video.created', async function () {
241 this.timeout(30000)
242
243 const { uuid } = await servers[1].videos.quickUpload({ name: 'remote video' })
244 videoUUID = uuid
245
246 await servers[0].servers.waitUntilLog('action:activity-pub.remote-video.created - AP remote video - video remote video')
247 })
248
249 it('Should run action:activity-pub.remote-video.updated', async function () {
250 this.timeout(30000)
251
252 await servers[1].videos.update({ id: videoUUID, attributes: { name: 'remote video updated' } })
253
254 await servers[0].servers.waitUntilLog('action:activity-pub.remote-video.updated - AP remote video - video remote video')
255 })
256 })
257
234 after(async function () { 258 after(async function () {
235 await cleanupTests(servers) 259 await cleanupTests(servers)
236 }) 260 })