]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/notifications/comments-notifications.ts
Increase timeout
[github/Chocobozzz/PeerTube.git] / server / tests / api / notifications / comments-notifications.ts
index b82f1712a0042160d1499a527a76331f9a0060e2..5a50af0402d1ce72406f6a2f2565f18ed9f838b2 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
 import {
   checkCommentMention,
   CheckerBaseParams,
@@ -12,8 +11,6 @@ import {
 import { UserNotification } from '@shared/models'
 import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test comments notifications', function () {
   let servers: PeerTubeServer[] = []
   let userToken: string
@@ -48,7 +45,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new comment notification after a comment on another video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'super video' } })
 
@@ -60,7 +57,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new comment notification if I comment my own video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
 
@@ -72,7 +69,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new comment notification if the account is muted', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       await servers[0].blocklist.addToMyBlocklist({ token: userToken, account: 'root' })
 
@@ -88,7 +85,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new comment notification after a local comment on my video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
 
@@ -100,7 +97,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new comment notification after a remote comment on my video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
 
@@ -118,7 +115,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new comment notification after a local reply on my video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
 
@@ -131,7 +128,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new comment notification after a remote reply on my video', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
       await waitJobs(servers)
@@ -157,7 +154,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should convert markdown in comment to html', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'cool video' } })
 
@@ -187,7 +184,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new mention comment notification if I mention the video owner', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ token: userToken, attributes: { name: 'super video' } })
 
@@ -198,7 +195,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new mention comment notification if I mention myself', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'super video' } })
 
@@ -209,7 +206,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new mention notification if the account is muted', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       await servers[0].blocklist.addToMyBlocklist({ token: userToken, account: 'root' })
 
@@ -224,7 +221,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should not send a new mention notification if the remote account mention a local account', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'super video' } })
 
@@ -238,7 +235,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new mention notification after local comments', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'super video' } })
 
@@ -254,13 +251,13 @@ describe('Test comments notifications', function () {
     })
 
     it('Should send a new mention notification after remote comments', async function () {
-      this.timeout(20000)
+      this.timeout(30000)
 
       const { uuid, shortUUID } = await servers[0].videos.upload({ attributes: { name: 'super video' } })
 
       await waitJobs(servers)
 
-      const text1 = `hello @user_1@localhost:${servers[0].port} 1`
+      const text1 = `hello @user_1@${servers[0].host} 1`
       const { id: server2ThreadId } = await servers[1].comments.createThread({ videoId: uuid, text: text1 })
 
       await waitJobs(servers)
@@ -272,7 +269,7 @@ describe('Test comments notifications', function () {
       const threadId = data[0].id
       await checkCommentMention({ ...baseParams, shortUUID, commentId: threadId, threadId, byAccountDisplayName, checkType: 'presence' })
 
-      const text2 = `@user_1@localhost:${servers[0].port} hello 2 @root@localhost:${servers[0].port}`
+      const text2 = `@user_1@${servers[0].host} hello 2 @root@${servers[0].host}`
       await servers[1].comments.addReply({ videoId: uuid, toCommentId: server2ThreadId, text: text2 })
 
       await waitJobs(servers)
@@ -286,7 +283,7 @@ describe('Test comments notifications', function () {
     })
 
     it('Should convert markdown in comment to html', async function () {
-      this.timeout(10000)
+      this.timeout(30000)
 
       const { uuid } = await servers[0].videos.upload({ attributes: { name: 'super video' } })