aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/user-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 16:49:51 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit6910f20f114b5bd020258a3a9a3f2117819a60c2 (patch)
tree0f50d33e20814b581dd9b2c175e511ac7a66f8df /server/tests/api/notifications/user-notifications.ts
parent313228e9c3b5bcef5391228c9b949d05d32ad7bb (diff)
downloadPeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.gz
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.tar.zst
PeerTube-6910f20f114b5bd020258a3a9a3f2117819a60c2.zip
Introduce import command
Diffstat (limited to 'server/tests/api/notifications/user-notifications.ts')
-rw-r--r--server/tests/api/notifications/user-notifications.ts30
1 files changed, 13 insertions, 17 deletions
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index 15be983f2..a9315c818 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -11,6 +11,7 @@ import {
11 checkVideoIsPublished, 11 checkVideoIsPublished,
12 cleanupTests, 12 cleanupTests,
13 getLastNotification, 13 getLastNotification,
14 ImportsCommand,
14 MockSmtpServer, 15 MockSmtpServer,
15 prepareNotificationsTest, 16 prepareNotificationsTest,
16 ServerInfo, 17 ServerInfo,
@@ -21,7 +22,6 @@ import {
21 wait, 22 wait,
22 waitJobs 23 waitJobs
23} from '@shared/extra-utils' 24} from '@shared/extra-utils'
24import { getBadVideoUrl, getGoodVideoUrl, importVideo } from '@shared/extra-utils/videos/video-imports'
25import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models' 25import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models'
26 26
27const expect = chai.expect 27const expect = chai.expect
@@ -209,14 +209,13 @@ describe('Test user notifications', function () {
209 name, 209 name,
210 channelId, 210 channelId,
211 privacy: VideoPrivacy.PUBLIC, 211 privacy: VideoPrivacy.PUBLIC,
212 targetUrl: getGoodVideoUrl() 212 targetUrl: ImportsCommand.getGoodVideoUrl()
213 } 213 }
214 const res = await importVideo(servers[0].url, servers[0].accessToken, attributes) 214 const { video } = await servers[0].importsCommand.importVideo({ attributes })
215 const uuid = res.body.video.uuid
216 215
217 await waitJobs(servers) 216 await waitJobs(servers)
218 217
219 await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence') 218 await checkNewVideoFromSubscription(baseParams, name, video.uuid, 'presence')
220 }) 219 })
221 }) 220 })
222 221
@@ -280,14 +279,13 @@ describe('Test user notifications', function () {
280 name, 279 name,
281 channelId, 280 channelId,
282 privacy: VideoPrivacy.PUBLIC, 281 privacy: VideoPrivacy.PUBLIC,
283 targetUrl: getGoodVideoUrl(), 282 targetUrl: ImportsCommand.getGoodVideoUrl(),
284 waitTranscoding: true 283 waitTranscoding: true
285 } 284 }
286 const res = await importVideo(servers[1].url, servers[1].accessToken, attributes) 285 const { video } = await servers[1].importsCommand.importVideo({ attributes })
287 const uuid = res.body.video.uuid
288 286
289 await waitJobs(servers) 287 await waitJobs(servers)
290 await checkVideoIsPublished(baseParams, name, uuid, 'presence') 288 await checkVideoIsPublished(baseParams, name, video.uuid, 'presence')
291 }) 289 })
292 290
293 it('Should send a notification when the scheduled update has been proceeded', async function () { 291 it('Should send a notification when the scheduled update has been proceeded', async function () {
@@ -349,13 +347,12 @@ describe('Test user notifications', function () {
349 name, 347 name,
350 channelId, 348 channelId,
351 privacy: VideoPrivacy.PRIVATE, 349 privacy: VideoPrivacy.PRIVATE,
352 targetUrl: getBadVideoUrl() 350 targetUrl: ImportsCommand.getBadVideoUrl()
353 } 351 }
354 const res = await importVideo(servers[0].url, servers[0].accessToken, attributes) 352 const { video } = await servers[0].importsCommand.importVideo({ attributes })
355 const uuid = res.body.video.uuid
356 353
357 await waitJobs(servers) 354 await waitJobs(servers)
358 await checkMyVideoImportIsFinished(baseParams, name, uuid, getBadVideoUrl(), false, 'presence') 355 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getBadVideoUrl(), false, 'presence')
359 }) 356 })
360 357
361 it('Should send a notification when the video import succeeded', async function () { 358 it('Should send a notification when the video import succeeded', async function () {
@@ -367,13 +364,12 @@ describe('Test user notifications', function () {
367 name, 364 name,
368 channelId, 365 channelId,
369 privacy: VideoPrivacy.PRIVATE, 366 privacy: VideoPrivacy.PRIVATE,
370 targetUrl: getGoodVideoUrl() 367 targetUrl: ImportsCommand.getGoodVideoUrl()
371 } 368 }
372 const res = await importVideo(servers[0].url, servers[0].accessToken, attributes) 369 const { video } = await servers[0].importsCommand.importVideo({ attributes })
373 const uuid = res.body.video.uuid
374 370
375 await waitJobs(servers) 371 await waitJobs(servers)
376 await checkMyVideoImportIsFinished(baseParams, name, uuid, getGoodVideoUrl(), true, 'presence') 372 await checkMyVideoImportIsFinished(baseParams, name, video.uuid, ImportsCommand.getGoodVideoUrl(), true, 'presence')
377 }) 373 })
378 }) 374 })
379 375