diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 16:40:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 2c27e70471120c92e0bc8c8114141fbb31ff98ac (patch) | |
tree | f52d89adc0351168fd1d89cbc07652e1408caaf2 /server/tests/api/notifications/notifications-api.ts | |
parent | 5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c (diff) | |
download | PeerTube-2c27e70471120c92e0bc8c8114141fbb31ff98ac.tar.gz PeerTube-2c27e70471120c92e0bc8c8114141fbb31ff98ac.tar.zst PeerTube-2c27e70471120c92e0bc8c8114141fbb31ff98ac.zip |
Introduce subscriptions command
Diffstat (limited to 'server/tests/api/notifications/notifications-api.ts')
-rw-r--r-- | server/tests/api/notifications/notifications-api.ts | 19 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { addUserSubscription } from '@shared/extra-utils/users/user-subscriptions' | ||
6 | import { cleanupTests, getMyUserInformation, immutableAssign, uploadRandomVideo, waitJobs } from '../../../../shared/extra-utils' | ||
7 | import { ServerInfo } from '../../../../shared/extra-utils/index' | ||
8 | import { MockSmtpServer } from '../../../../shared/extra-utils/mock-servers/mock-email' | ||
9 | import { | 5 | import { |
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, |
19 | import { User, UserNotification, UserNotificationSettingValue } from '../../../../shared/models/users' | 19 | uploadRandomVideo, |
20 | waitJobs | ||
21 | } from '@shared/extra-utils' | ||
22 | import { User, UserNotification, UserNotificationSettingValue } from '@shared/models' | ||
20 | 23 | ||
21 | const expect = chai.expect | 24 | const 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) |