]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/notifications/user-notifications.ts
Fix stats tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / notifications / user-notifications.ts
index e5f6aa864427d185666f4a32818f2194a0ac4986..7e88d979b89bc527eaf9ab6a45add874c5e3becb 100644 (file)
@@ -24,7 +24,7 @@ import {
   prepareNotificationsTest
 } from '../../../../shared/extra-utils/users/user-notifications'
 import { addUserSubscription, removeUserSubscription } from '../../../../shared/extra-utils/users/user-subscriptions'
-import { getBadVideoUrl, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
+import { getBadVideoUrl, getGoodVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
 import { UserNotification, UserNotificationType } from '../../../../shared/models/users'
 import { VideoPrivacy } from '../../../../shared/models/videos'
 
@@ -65,7 +65,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send notifications if the user does not follow the video publisher', async function () {
-      this.timeout(10000)
+      this.timeout(50000)
 
       await uploadRandomVideoOnServers(servers, 1)
 
@@ -87,7 +87,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should send a new video notification from a remote account', async function () {
-      this.timeout(50000) // Server 2 has transcoding enabled
+      this.timeout(150000) // Server 2 has transcoding enabled
 
       await addUserSubscription(servers[0].url, userAccessToken, 'root_channel@localhost:' + servers[1].port)
       await waitJobs(servers)
@@ -97,7 +97,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should send a new video notification on a scheduled publication', async function () {
-      this.timeout(20000)
+      this.timeout(50000)
 
       // In 2 seconds
       const updateAt = new Date(new Date().getTime() + 2000)
@@ -116,7 +116,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should send a new video notification on a remote scheduled publication', async function () {
-      this.timeout(50000)
+      this.timeout(100000)
 
       // In 2 seconds
       const updateAt = new Date(new Date().getTime() + 2000)
@@ -136,7 +136,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send a notification before the video is published', async function () {
-      this.timeout(20000)
+      this.timeout(50000)
 
       const updateAt = new Date(new Date().getTime() + 1000000)
 
@@ -154,7 +154,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should send a new video notification when a video becomes public', async function () {
-      this.timeout(10000)
+      this.timeout(50000)
 
       const data = { privacy: VideoPrivacy.PRIVATE }
       const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
@@ -163,12 +163,12 @@ describe('Test user notifications', function () {
 
       await updateVideo(servers[0].url, servers[0].accessToken, uuid, { privacy: VideoPrivacy.PUBLIC })
 
-      await wait(500)
+      await waitJobs(servers)
       await checkNewVideoFromSubscription(baseParams, name, uuid, 'presence')
     })
 
     it('Should send a new video notification when a remote video becomes public', async function () {
-      this.timeout(20000)
+      this.timeout(50000)
 
       const data = { privacy: VideoPrivacy.PRIVATE }
       const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
@@ -182,7 +182,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send a new video notification when a video becomes unlisted', async function () {
-      this.timeout(20000)
+      this.timeout(50000)
 
       const data = { privacy: VideoPrivacy.PRIVATE }
       const { name, uuid } = await uploadRandomVideoOnServers(servers, 1, data)
@@ -193,7 +193,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send a new video notification when a remote video becomes unlisted', async function () {
-      this.timeout(20000)
+      this.timeout(50000)
 
       const data = { privacy: VideoPrivacy.PRIVATE }
       const { name, uuid } = await uploadRandomVideoOnServers(servers, 2, data)
@@ -213,7 +213,7 @@ describe('Test user notifications', function () {
         name,
         channelId,
         privacy: VideoPrivacy.PUBLIC,
-        targetUrl: getYoutubeVideoUrl()
+        targetUrl: getGoodVideoUrl()
       }
       const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
       const uuid = res.body.video.uuid
@@ -237,7 +237,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send a notification if transcoding is not enabled', async function () {
-      this.timeout(10000)
+      this.timeout(50000)
 
       const { name, uuid } = await uploadRandomVideoOnServers(servers, 1)
       await waitJobs(servers)
@@ -284,7 +284,7 @@ describe('Test user notifications', function () {
         name,
         channelId,
         privacy: VideoPrivacy.PUBLIC,
-        targetUrl: getYoutubeVideoUrl(),
+        targetUrl: getGoodVideoUrl(),
         waitTranscoding: true
       }
       const res = await importVideo(servers[1].url, servers[1].accessToken, attributes)
@@ -314,7 +314,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should not send a notification before the video is published', async function () {
-      this.timeout(40000)
+      this.timeout(50000)
 
       const updateAt = new Date(new Date().getTime() + 1000000)
 
@@ -371,13 +371,13 @@ describe('Test user notifications', function () {
         name,
         channelId,
         privacy: VideoPrivacy.PRIVATE,
-        targetUrl: getYoutubeVideoUrl()
+        targetUrl: getGoodVideoUrl()
       }
       const res = await importVideo(servers[0].url, servers[0].accessToken, attributes)
       const uuid = res.body.video.uuid
 
       await waitJobs(servers)
-      await checkMyVideoImportIsFinished(baseParams, name, uuid, getYoutubeVideoUrl(), true, 'presence')
+      await checkMyVideoImportIsFinished(baseParams, name, uuid, getGoodVideoUrl(), true, 'presence')
     })
   })
 
@@ -416,7 +416,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should notify when a local channel is following one of our channel', async function () {
-      this.timeout(10000)
+      this.timeout(50000)
 
       await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port)
       await waitJobs(servers)
@@ -427,7 +427,7 @@ describe('Test user notifications', function () {
     })
 
     it('Should notify when a remote channel is following one of our channel', async function () {
-      this.timeout(10000)
+      this.timeout(50000)
 
       await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port)
       await waitJobs(servers)
@@ -439,7 +439,7 @@ describe('Test user notifications', function () {
 
     // PeerTube does not support accout -> account follows
     // it('Should notify when a local account is following one of our channel', async function () {
-    //   this.timeout(10000)
+    //   this.timeout(50000)
     //
     //   await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:' + servers[0].port)
     //
@@ -449,7 +449,7 @@ describe('Test user notifications', function () {
     // })
 
     // it('Should notify when a remote account is following one of our channel', async function () {
-    //   this.timeout(10000)
+    //   this.timeout(50000)
     //
     //   await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:' + servers[0].port)
     //