]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/action-hooks.ts
Optimize fetching playlist urls
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / action-hooks.ts
index 209db95a44b835c4bab13ca9fdcf1d0711fabc74..af65166d9965869a516d2983ee4ac9cf5ee97cb7 100644 (file)
@@ -1,6 +1,5 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
 import {
   cleanupTests,
@@ -17,8 +16,8 @@ describe('Test plugin action hooks', function () {
   let videoUUID: string
   let threadId: number
 
-  function checkHook (hook: ServerHookName) {
-    return servers[0].servers.waitUntilLog('Run hook ' + hook)
+  function checkHook (hook: ServerHookName, strictCount = true) {
+    return servers[0].servers.waitUntilLog('Run hook ' + hook, 1, strictCount)
   }
 
   before(async function () {
@@ -225,6 +224,13 @@ describe('Test plugin action hooks', function () {
     })
   })
 
+  describe('Notification hook', function () {
+
+    it('Should run action:notifier.notification.created', async function () {
+      await checkHook('action:notifier.notification.created', false)
+    })
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })