]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/notifications/notifications-api.ts
Introduce subscriptions command
[github/Chocobozzz/PeerTube.git] / server / tests / api / notifications / notifications-api.ts
index 19f9dbbab8a4819db9c774ee69ac3427820a7c2a..1ed98ae7aba8b3f497cc21d22cb3710e3133c95f 100644 (file)
@@ -2,21 +2,24 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions'
-import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils'
-import { ServerInfo } from '../../../../shared/extra-utils/index'
-import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email'
 import {
   CheckerBaseParams,
   checkNewVideoFromSubscription,
+  cleanupTests,
   getAllNotificationsSettings,
+  getMyUserInformation,
   getUserNotifications,
+  immutableAssign,
   markAsReadAllNotifications,
   markAsReadNotifications,
+  MockSmtpServer,
   prepareNotificationsTest,
-  updateMyNotificationSettings
-} from '../../../../shared/extra-utils/users/user-notifications'
-import { User, UserNotification, UserNotificationSettingValue } from '../../../../shared/models/users'
+  ServerInfo,
+  updateMyNotificationSettings,
+  uploadRandomVideo,
+  waitJobs
+} from '@shared/extra-utils'
+import { User, UserNotification, UserNotificationSettingValue } from '@shared/models'
 
 const expect = chai.expect
 
@@ -35,7 +38,7 @@ describe('Test notifications API', function () {
     userNotifications = res.userNotifications
     server = res.servers[0]
 
-    await addUserSubscription(server.url, userAccessToken, 'root_channel@localhost:' + server.port)
+    await server.subscriptionsCommand.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + server.port })
 
     for (let i = 0; i < 10; i++) {
       await uploadRandomVideo(server, false)