aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/user-notifications.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/notifications/user-notifications.ts')
-rw-r--r--server/tests/api/notifications/user-notifications.ts40
1 files changed, 20 insertions, 20 deletions
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index 4db8c1576..53f8c7594 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -61,7 +61,7 @@ describe('Test user notifications', function () {
61 61
62 await uploadRandomVideoOnServers(servers, 1) 62 await uploadRandomVideoOnServers(servers, 1)
63 63
64 const notification = await servers[0].notificationsCommand.getLastest({ token: userAccessToken }) 64 const notification = await servers[0].notifications.getLastest({ token: userAccessToken })
65 expect(notification).to.be.undefined 65 expect(notification).to.be.undefined
66 66
67 expect(emails).to.have.lengthOf(0) 67 expect(emails).to.have.lengthOf(0)
@@ -71,7 +71,7 @@ describe('Test user notifications', function () {
71 it('Should send a new video notification if the user follows the local video publisher', async function () { 71 it('Should send a new video notification if the user follows the local video publisher', async function () {
72 this.timeout(15000) 72 this.timeout(15000)
73 73
74 await servers[0].subscriptionsCommand.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[0].port }) 74 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[0].port })
75 await waitJobs(servers) 75 await waitJobs(servers)
76 76
77 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1) 77 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1)
@@ -81,7 +81,7 @@ describe('Test user notifications', function () {
81 it('Should send a new video notification from a remote account', async function () { 81 it('Should send a new video notification from a remote account', async function () {
82 this.timeout(150000) // Server 2 has transcoding enabled 82 this.timeout(150000) // Server 2 has transcoding enabled
83 83
84 await servers[0].subscriptionsCommand.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[1].port }) 84 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[1].port })
85 await waitJobs(servers) 85 await waitJobs(servers)
86 86
87 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2) 87 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2)
@@ -153,7 +153,7 @@ describe('Test user notifications', function () {
153 153
154 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence') 154 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence')
155 155
156 await servers[0].videosCommand.update({ id: uuid, attributes: { privacy: VideoPrivacy.PUBLIC } }) 156 await servers[0].videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.PUBLIC } })
157 157
158 await waitJobs(servers) 158 await waitJobs(servers)
159 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence') 159 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence')
@@ -167,7 +167,7 @@ describe('Test user notifications', function () {
167 167
168 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence') 168 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence')
169 169
170 await servers[1].videosCommand.update({ id: uuid, attributes: { privacy: VideoPrivacy.PUBLIC } }) 170 await servers[1].videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.PUBLIC } })
171 171
172 await waitJobs(servers) 172 await waitJobs(servers)
173 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence') 173 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence')
@@ -179,7 +179,7 @@ describe('Test user notifications', function () {
179 const data = { privacy: VideoPrivacy.PRIVATE } 179 const data = { privacy: VideoPrivacy.PRIVATE }
180 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data) 180 const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
181 181
182 await servers[0].videosCommand.update({ id: uuid, attributes: { privacy: VideoPrivacy.UNLISTED } }) 182 await servers[0].videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.UNLISTED } })
183 183
184 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence') 184 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence')
185 }) 185 })
@@ -190,7 +190,7 @@ describe('Test user notifications', function () {
190 const data = { privacy: VideoPrivacy.PRIVATE } 190 const data = { privacy: VideoPrivacy.PRIVATE }
191 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data) 191 const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
192 192
193 await servers[1].videosCommand.update({ id: uuid, attributes: { privacy: VideoPrivacy.UNLISTED } }) 193 await servers[1].videos.update({ id: uuid, attributes: { privacy: VideoPrivacy.UNLISTED } })
194 194
195 await waitJobs(servers) 195 await waitJobs(servers)
196 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence') 196 await checkNewVideoFromSubscription(baseParams, name, uuid, 'absence')
@@ -207,7 +207,7 @@ describe('Test user notifications', function () {
207 privacy: VideoPrivacy.PUBLIC, 207 privacy: VideoPrivacy.PUBLIC,
208 targetUrl: ImportsCommand.getGoodVideoUrl() 208 targetUrl: ImportsCommand.getGoodVideoUrl()
209 } 209 }
210 const { video } = await servers[0].importsCommand.importVideo({ attributes }) 210 const { video } = await servers[0].imports.importVideo({ attributes })
211 211
212 await waitJobs(servers) 212 await waitJobs(servers)
213 213
@@ -242,7 +242,7 @@ describe('Test user notifications', function () {
242 await uploadRandomVideoOnServers(servers, 2, { waitTranscoding: false }) 242 await uploadRandomVideoOnServers(servers, 2, { waitTranscoding: false })
243 await waitJobs(servers) 243 await waitJobs(servers)
244 244
245 const notification = await servers[0].notificationsCommand.getLastest({ token: userAccessToken }) 245 const notification = await servers[0].notifications.getLastest({ token: userAccessToken })
246 if (notification) { 246 if (notification) {
247 expect(notification.type).to.not.equal(UserNotificationType.MY_VIDEO_PUBLISHED) 247 expect(notification.type).to.not.equal(UserNotificationType.MY_VIDEO_PUBLISHED)
248 } 248 }
@@ -278,7 +278,7 @@ describe('Test user notifications', function () {
278 targetUrl: ImportsCommand.getGoodVideoUrl(), 278 targetUrl: ImportsCommand.getGoodVideoUrl(),
279 waitTranscoding: true 279 waitTranscoding: true
280 } 280 }
281 const { video } = await servers[1].importsCommand.importVideo({ attributes }) 281 const { video } = await servers[1].imports.importVideo({ attributes })
282 282
283 await waitJobs(servers) 283 await waitJobs(servers)
284 await checkVideoIsPublished(baseParams, name, video.uuid, 'presence') 284 await checkVideoIsPublished(baseParams, name, video.uuid, 'presence')
@@ -345,7 +345,7 @@ describe('Test user notifications', function () {
345 privacy: VideoPrivacy.PRIVATE, 345 privacy: VideoPrivacy.PRIVATE,
346 targetUrl: ImportsCommand.getBadVideoUrl() 346 targetUrl: ImportsCommand.getBadVideoUrl()
347 } 347 }
348 const { video } = await servers[0].importsCommand.importVideo({ attributes }) 348 const { video } = await servers[0].imports.importVideo({ attributes })
349 349
350 await waitJobs(servers) 350 await waitJobs(servers)
351 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getBadVideoUrl(), false, 'presence') 351 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getBadVideoUrl(), false, 'presence')
@@ -362,7 +362,7 @@ describe('Test user notifications', function () {
362 privacy: VideoPrivacy.PRIVATE, 362 privacy: VideoPrivacy.PRIVATE,
363 targetUrl: ImportsCommand.getGoodVideoUrl() 363 targetUrl: ImportsCommand.getGoodVideoUrl()
364 } 364 }
365 const { video } = await servers[0].importsCommand.importVideo({ attributes }) 365 const { video } = await servers[0].imports.importVideo({ attributes })
366 366
367 await waitJobs(servers) 367 await waitJobs(servers)
368 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getGoodVideoUrl(), true, 'presence') 368 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getGoodVideoUrl(), true, 'presence')
@@ -382,16 +382,16 @@ describe('Test user notifications', function () {
382 token: userAccessToken 382 token: userAccessToken
383 } 383 }
384 384
385 await servers[0].usersCommand.updateMe({ displayName: 'super root name' }) 385 await servers[0].users.updateMe({ displayName: 'super root name' })
386 386
387 await servers[0].usersCommand.updateMe({ 387 await servers[0].users.updateMe({
388 token: userAccessToken, 388 token: userAccessToken,
389 displayName: myUserName 389 displayName: myUserName
390 }) 390 })
391 391
392 await servers[1].usersCommand.updateMe({ displayName: 'super root 2 name' }) 392 await servers[1].users.updateMe({ displayName: 'super root 2 name' })
393 393
394 await servers[0].channelsCommand.update({ 394 await servers[0].channels.update({
395 token: userAccessToken, 395 token: userAccessToken,
396 channelName: 'user_1_channel', 396 channelName: 'user_1_channel',
397 attributes: { displayName: myChannelName } 397 attributes: { displayName: myChannelName }
@@ -401,23 +401,23 @@ describe('Test user notifications', function () {
401 it('Should notify when a local channel is following one of our channel', async function () { 401 it('Should notify when a local channel is following one of our channel', async function () {
402 this.timeout(50000) 402 this.timeout(50000)
403 403
404 await servers[0].subscriptionsCommand.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 404 await servers[0].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port })
405 await waitJobs(servers) 405 await waitJobs(servers)
406 406
407 await checkNewActorFollow(baseParams, 'channel', 'root', 'super root name', myChannelName, 'presence') 407 await checkNewActorFollow(baseParams, 'channel', 'root', 'super root name', myChannelName, 'presence')
408 408
409 await servers[0].subscriptionsCommand.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 409 await servers[0].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port })
410 }) 410 })
411 411
412 it('Should notify when a remote channel is following one of our channel', async function () { 412 it('Should notify when a remote channel is following one of our channel', async function () {
413 this.timeout(50000) 413 this.timeout(50000)
414 414
415 await servers[1].subscriptionsCommand.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 415 await servers[1].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port })
416 await waitJobs(servers) 416 await waitJobs(servers)
417 417
418 await checkNewActorFollow(baseParams, 'channel', 'root', 'super root 2 name', myChannelName, 'presence') 418 await checkNewActorFollow(baseParams, 'channel', 'root', 'super root 2 name', myChannelName, 'presence')
419 419
420 await servers[1].subscriptionsCommand.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 420 await servers[1].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port })
421 }) 421 })
422 422
423 // PeerTube does not support accout -> account follows 423 // PeerTube does not support accout -> account follows