aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/notifications-api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/notifications/notifications-api.ts')
-rw-r--r--server/tests/api/notifications/notifications-api.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts
index 19f9dbbab..1ed98ae7a 100644
--- a/server/tests/api/notifications/notifications-api.ts
+++ b/server/tests/api/notifications/notifications-api.ts
@@ -2,21 +2,24 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions'
6import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils'
7import { ServerInfo } from '../../../../shared/extra-utils/index'
8import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email'
9import { 5import {
10 CheckerBaseParams, 6 CheckerBaseParams,
11 checkNewVideoFromSubscription, 7 checkNewVideoFromSubscription,
8 cleanupTests,
12 getAllNotificationsSettings, 9 getAllNotificationsSettings,
10 getMyUserInformation,
13 getUserNotifications, 11 getUserNotifications,
12 immutableAssign,
14 markAsReadAllNotifications, 13 markAsReadAllNotifications,
15 markAsReadNotifications, 14 markAsReadNotifications,
15 MockSmtpServer,
16 prepareNotificationsTest, 16 prepareNotificationsTest,
17 updateMyNotificationSettings 17 ServerInfo,
18} from '../../../../shared/extra-utils/users/user-notifications' 18 updateMyNotificationSettings,
19import { User, UserNotification, UserNotificationSettingValue } from '../../../../shared/models/users' 19 uploadRandomVideo,
20 waitJobs
21} from '@shared/extra-utils'
22import { User, UserNotification, UserNotificationSettingValue } from '@shared/models'
20 23
21const expect = chai.expect 24const expect = chai.expect
22 25
@@ -35,7 +38,7 @@ describe('Test notifications API', function () {
35 userNotifications = res.userNotifications 38 userNotifications = res.userNotifications
36 server = res.servers[0] 39 server = res.servers[0]
37 40
38 await addUserSubscription(server.url, userAccessToken, 'root_channel@localhost:' + server.port) 41 await server.subscriptionsCommand.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + server.port })
39 42
40 for (let i = 0; i < 10; i++) { 43 for (let i = 0; i < 10; i++) {
41 await uploadRandomVideo(server, false) 44 await uploadRandomVideo(server, false)