diff options
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r-- | server/tests/plugins/action-hooks.ts | 24 |
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 | |||
4 | import { | 4 | import { |
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 | }) |