diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 3 | ||||
-rw-r--r-- | server/tests/plugins/action-hooks.ts | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 04e059848..90951d611 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -13,6 +13,9 @@ async function register ({ registerHook, registerSetting, settingsManager, stora | |||
13 | 'action:api.video-comment-reply.created', | 13 | 'action:api.video-comment-reply.created', |
14 | 'action:api.video-comment.deleted', | 14 | 'action:api.video-comment.deleted', |
15 | 15 | ||
16 | 'action:api.video-caption.created', | ||
17 | 'action:api.video-caption.deleted', | ||
18 | |||
16 | 'action:api.user.blocked', | 19 | 'action:api.user.blocked', |
17 | 'action:api.user.unblocked', | 20 | 'action:api.user.unblocked', |
18 | 'action:api.user.registered', | 21 | 'action:api.user.registered', |
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts index 686926c17..8788a9644 100644 --- a/server/tests/plugins/action-hooks.ts +++ b/server/tests/plugins/action-hooks.ts | |||
@@ -103,6 +103,20 @@ describe('Test plugin action hooks', function () { | |||
103 | }) | 103 | }) |
104 | }) | 104 | }) |
105 | 105 | ||
106 | describe('Captions hooks', function () { | ||
107 | it('Should run action:api.video-caption.created', async function () { | ||
108 | await servers[0].captions.add({ videoId: videoUUID, language: 'en', fixture: 'subtitle-good.srt' }) | ||
109 | |||
110 | await checkHook('action:api.video-caption.created') | ||
111 | }) | ||
112 | |||
113 | it('Should run action:api.video-caption.deleted', async function () { | ||
114 | await servers[0].captions.delete({ videoId: videoUUID, language: 'en' }) | ||
115 | |||
116 | await checkHook('action:api.video-caption.deleted') | ||
117 | }) | ||
118 | }) | ||
119 | |||
106 | describe('Users hooks', function () { | 120 | describe('Users hooks', function () { |
107 | let userId: number | 121 | let userId: number |
108 | 122 | ||