diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test/main.js | 1 | ||||
-rw-r--r-- | server/tests/plugins/action-hooks.ts | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 8d7584eba..b3febfa12 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js | |||
@@ -1,6 +1,7 @@ | |||
1 | async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) { | 1 | async function register ({ registerHook, registerSetting, settingsManager, storageManager, peertubeHelpers }) { |
2 | const actionHooks = [ | 2 | const actionHooks = [ |
3 | 'action:application.listening', | 3 | 'action:application.listening', |
4 | 'action:notifier.notification.created', | ||
4 | 5 | ||
5 | 'action:api.video.updated', | 6 | 'action:api.video.updated', |
6 | 'action:api.video.deleted', | 7 | 'action:api.video.deleted', |
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts index 209db95a4..405f81d7c 100644 --- a/server/tests/plugins/action-hooks.ts +++ b/server/tests/plugins/action-hooks.ts | |||
@@ -17,8 +17,8 @@ describe('Test plugin action hooks', function () { | |||
17 | let videoUUID: string | 17 | let videoUUID: string |
18 | let threadId: number | 18 | let threadId: number |
19 | 19 | ||
20 | function checkHook (hook: ServerHookName) { | 20 | function checkHook (hook: ServerHookName, strictCount = true) { |
21 | return servers[0].servers.waitUntilLog('Run hook ' + hook) | 21 | return servers[0].servers.waitUntilLog('Run hook ' + hook, 1, strictCount) |
22 | } | 22 | } |
23 | 23 | ||
24 | before(async function () { | 24 | before(async function () { |
@@ -225,6 +225,13 @@ describe('Test plugin action hooks', function () { | |||
225 | }) | 225 | }) |
226 | }) | 226 | }) |
227 | 227 | ||
228 | describe('Notification hook', function () { | ||
229 | |||
230 | it('Should run action:notifier.notification.created', async function () { | ||
231 | await checkHook('action:notifier.notification.created', false) | ||
232 | }) | ||
233 | }) | ||
234 | |||
228 | after(async function () { | 235 | after(async function () { |
229 | await cleanupTests(servers) | 236 | await cleanupTests(servers) |
230 | }) | 237 | }) |