diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-03 11:33:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-03 11:33:43 +0200 |
commit | 785f1897a42984ece9c6f65829d195d67e331d95 (patch) | |
tree | 1cb3b33cfc797b8f1abbab90749c1e3187bbd311 /server/tests | |
parent | 0260dc8aca952f9412a8620e433b9e16e675696e (diff) | |
download | PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.tar.gz PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.tar.zst PeerTube-785f1897a42984ece9c6f65829d195d67e331d95.zip |
Add notification plugin hook
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 | }) |