]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/notifications/admin-notifications.ts
Increase test timeout
[github/Chocobozzz/PeerTube.git] / server / tests / api / notifications / admin-notifications.ts
index d65551f0a29399bf32453f4b44264c513de1becf..b3bb4888ec9e071b07cdcbcd9af2599d082e1892 100644 (file)
@@ -1,19 +1,17 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
 import {
   CheckerBaseParams,
   checkNewPeerTubeVersion,
   checkNewPluginVersion,
-  cleanupTests,
   MockJoinPeerTubeVersions,
   MockSmtpServer,
-  prepareNotificationsTest,
-  PeerTubeServer,
-  wait
-} from '@shared/extra-utils'
+  prepareNotificationsTest
+} from '@server/tests/shared'
+import { wait } from '@shared/core-utils'
 import { PluginType, UserNotification, UserNotificationType } from '@shared/models'
+import { cleanupTests, PeerTubeServer } from '@shared/server-commands'
 
 describe('Test admin notifications', function () {
   let server: PeerTubeServer
@@ -52,7 +50,7 @@ describe('Test admin notifications', function () {
     adminNotifications = res.adminNotifications
 
     baseParams = {
-      server: server,
+      server,
       emails,
       socketNotifications: adminNotifications,
       token: server.accessToken
@@ -70,7 +68,7 @@ describe('Test admin notifications', function () {
       joinPeerTubeServer.setLatestVersion('1.4.2')
 
       await wait(3000)
-      await checkNewPeerTubeVersion(baseParams, '1.4.2', 'absence')
+      await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '1.4.2', checkType: 'absence' })
     })
 
     it('Should send a notification to admins on new plugin version', async function () {
@@ -79,7 +77,7 @@ describe('Test admin notifications', function () {
       joinPeerTubeServer.setLatestVersion('15.4.2')
 
       await wait(3000)
-      await checkNewPeerTubeVersion(baseParams, '15.4.2', 'presence')
+      await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '15.4.2', checkType: 'presence' })
     })
 
     it('Should not send the same notification to admins', async function () {
@@ -101,7 +99,7 @@ describe('Test admin notifications', function () {
       joinPeerTubeServer.setLatestVersion('15.4.3')
 
       await wait(3000)
-      await checkNewPeerTubeVersion(baseParams, '15.4.3', 'presence')
+      await checkNewPeerTubeVersion({ ...baseParams, latestVersion: '15.4.3', checkType: 'presence' })
       expect(adminNotifications.filter(n => n.type === UserNotificationType.NEW_PEERTUBE_VERSION)).to.have.lengthOf(2)
     })
   })
@@ -112,7 +110,7 @@ describe('Test admin notifications', function () {
       this.timeout(30000)
 
       await wait(6000)
-      await checkNewPluginVersion(baseParams, PluginType.PLUGIN, 'hello-world', 'absence')
+      await checkNewPluginVersion({ ...baseParams, pluginType: PluginType.PLUGIN, pluginName: 'hello-world', checkType: 'absence' })
     })
 
     it('Should send a notification to admins on new plugin version', async function () {
@@ -122,7 +120,7 @@ describe('Test admin notifications', function () {
       await server.sql.setPluginLatestVersion('hello-world', '0.0.1')
       await wait(6000)
 
-      await checkNewPluginVersion(baseParams, PluginType.PLUGIN, 'hello-world', 'presence')
+      await checkNewPluginVersion({ ...baseParams, pluginType: PluginType.PLUGIN, pluginName: 'hello-world', checkType: 'presence' })
     })
 
     it('Should not send the same notification to admins', async function () {