aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/notifications-api.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-15 10:02:54 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch)
treeda82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/notifications/notifications-api.ts
parent7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff)
downloadPeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip
Introduce videos command
Diffstat (limited to 'server/tests/api/notifications/notifications-api.ts')
-rw-r--r--server/tests/api/notifications/notifications-api.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts
index f33d8e64d..41e1b8015 100644
--- a/server/tests/api/notifications/notifications-api.ts
+++ b/server/tests/api/notifications/notifications-api.ts
@@ -10,7 +10,6 @@ import {
10 MockSmtpServer, 10 MockSmtpServer,
11 prepareNotificationsTest, 11 prepareNotificationsTest,
12 ServerInfo, 12 ServerInfo,
13 uploadRandomVideo,
14 waitJobs 13 waitJobs
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { UserNotification, UserNotificationSettingValue } from '@shared/models' 15import { UserNotification, UserNotificationSettingValue } from '@shared/models'
@@ -35,7 +34,7 @@ describe('Test notifications API', function () {
35 await server.subscriptionsCommand.add({ token: userToken, targetUri: 'root_channel@localhost:' + server.port }) 34 await server.subscriptionsCommand.add({ token: userToken, targetUri: 'root_channel@localhost:' + server.port })
36 35
37 for (let i = 0; i < 10; i++) { 36 for (let i = 0; i < 10; i++) {
38 await uploadRandomVideo(server, false) 37 await server.videosCommand.randomUpload({ wait: false })
39 } 38 }
40 39
41 await waitJobs([ server ]) 40 await waitJobs([ server ])
@@ -112,7 +111,7 @@ describe('Test notifications API', function () {
112 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.NONE) 111 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.NONE)
113 } 112 }
114 113
115 const { name, uuid } = await uploadRandomVideo(server) 114 const { name, uuid } = await server.videosCommand.randomUpload()
116 115
117 const check = { web: true, mail: true } 116 const check = { web: true, mail: true }
118 await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'absence') 117 await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'absence')
@@ -131,7 +130,7 @@ describe('Test notifications API', function () {
131 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.WEB) 130 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.WEB)
132 } 131 }
133 132
134 const { name, uuid } = await uploadRandomVideo(server) 133 const { name, uuid } = await server.videosCommand.randomUpload()
135 134
136 { 135 {
137 const check = { mail: true, web: false } 136 const check = { mail: true, web: false }
@@ -157,7 +156,7 @@ describe('Test notifications API', function () {
157 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.EMAIL) 156 expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.EMAIL)
158 } 157 }
159 158
160 const { name, uuid } = await uploadRandomVideo(server) 159 const { name, uuid } = await server.videosCommand.randomUpload()
161 160
162 { 161 {
163 const check = { mail: false, web: true } 162 const check = { mail: false, web: true }
@@ -188,7 +187,7 @@ describe('Test notifications API', function () {
188 ) 187 )
189 } 188 }
190 189
191 const { name, uuid } = await uploadRandomVideo(server) 190 const { name, uuid } = await server.videosCommand.randomUpload()
192 191
193 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence') 192 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence')
194 }) 193 })