diff options
Diffstat (limited to 'server/tests/api/notifications/comments-notifications.ts')
-rw-r--r-- | server/tests/api/notifications/comments-notifications.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts index cd3ed2f70..dfe846cc4 100644 --- a/server/tests/api/notifications/comments-notifications.ts +++ b/server/tests/api/notifications/comments-notifications.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { cleanupTests, getVideoCommentThreads, getVideoThreadComments, updateMyUser, wait } from '../../../../shared/extra-utils' | 5 | import { cleanupTests, getVideoCommentThreads, getVideoThreadComments, updateMyUser } from '../../../../shared/extra-utils' |
6 | import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' | 6 | import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' |
7 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 7 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' |
8 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | 8 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' |
@@ -56,7 +56,7 @@ describe('Test comments notifications', function () { | |||
56 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') | 56 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') |
57 | const commentId = resComment.body.comment.id | 57 | const commentId = resComment.body.comment.id |
58 | 58 | ||
59 | await wait(500) | 59 | await waitJobs(servers) |
60 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') | 60 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') |
61 | }) | 61 | }) |
62 | 62 | ||
@@ -69,7 +69,7 @@ describe('Test comments notifications', function () { | |||
69 | const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, 'comment') | 69 | const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, 'comment') |
70 | const commentId = resComment.body.comment.id | 70 | const commentId = resComment.body.comment.id |
71 | 71 | ||
72 | await wait(500) | 72 | await waitJobs(servers) |
73 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') | 73 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') |
74 | }) | 74 | }) |
75 | 75 | ||
@@ -84,7 +84,7 @@ describe('Test comments notifications', function () { | |||
84 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') | 84 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') |
85 | const commentId = resComment.body.comment.id | 85 | const commentId = resComment.body.comment.id |
86 | 86 | ||
87 | await wait(500) | 87 | await waitJobs(servers) |
88 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') | 88 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'absence') |
89 | 89 | ||
90 | await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') | 90 | await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') |
@@ -99,7 +99,7 @@ describe('Test comments notifications', function () { | |||
99 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') | 99 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, 'comment') |
100 | const commentId = resComment.body.comment.id | 100 | const commentId = resComment.body.comment.id |
101 | 101 | ||
102 | await wait(500) | 102 | await waitJobs(servers) |
103 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'presence') | 103 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, commentId, 'presence') |
104 | }) | 104 | }) |
105 | 105 | ||
@@ -134,7 +134,7 @@ describe('Test comments notifications', function () { | |||
134 | const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'reply') | 134 | const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'reply') |
135 | const commentId = resComment.body.comment.id | 135 | const commentId = resComment.body.comment.id |
136 | 136 | ||
137 | await wait(500) | 137 | await waitJobs(servers) |
138 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, threadId, 'presence') | 138 | await checkNewCommentOnMyVideo(baseParams, uuid, commentId, threadId, 'presence') |
139 | }) | 139 | }) |
140 | 140 | ||
@@ -200,7 +200,7 @@ describe('Test comments notifications', function () { | |||
200 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') | 200 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') |
201 | const commentId = resComment.body.comment.id | 201 | const commentId = resComment.body.comment.id |
202 | 202 | ||
203 | await wait(500) | 203 | await waitJobs(servers) |
204 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') | 204 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') |
205 | }) | 205 | }) |
206 | 206 | ||
@@ -213,7 +213,7 @@ describe('Test comments notifications', function () { | |||
213 | const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, '@user_1 hello') | 213 | const resComment = await addVideoCommentThread(servers[0].url, userAccessToken, uuid, '@user_1 hello') |
214 | const commentId = resComment.body.comment.id | 214 | const commentId = resComment.body.comment.id |
215 | 215 | ||
216 | await wait(500) | 216 | await waitJobs(servers) |
217 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') | 217 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') |
218 | }) | 218 | }) |
219 | 219 | ||
@@ -228,7 +228,7 @@ describe('Test comments notifications', function () { | |||
228 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') | 228 | const resComment = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello') |
229 | const commentId = resComment.body.comment.id | 229 | const commentId = resComment.body.comment.id |
230 | 230 | ||
231 | await wait(500) | 231 | await waitJobs(servers) |
232 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') | 232 | await checkCommentMention(baseParams, uuid, commentId, commentId, 'super root name', 'absence') |
233 | 233 | ||
234 | await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') | 234 | await removeAccountFromAccountBlocklist(servers[0].url, userAccessToken, 'root') |
@@ -257,13 +257,13 @@ describe('Test comments notifications', function () { | |||
257 | const resThread = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello 1') | 257 | const resThread = await addVideoCommentThread(servers[0].url, servers[0].accessToken, uuid, '@user_1 hello 1') |
258 | const threadId = resThread.body.comment.id | 258 | const threadId = resThread.body.comment.id |
259 | 259 | ||
260 | await wait(500) | 260 | await waitJobs(servers) |
261 | await checkCommentMention(baseParams, uuid, threadId, threadId, 'super root name', 'presence') | 261 | await checkCommentMention(baseParams, uuid, threadId, threadId, 'super root name', 'presence') |
262 | 262 | ||
263 | const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'hello 2 @user_1') | 263 | const resComment = await addVideoCommentReply(servers[0].url, servers[0].accessToken, uuid, threadId, 'hello 2 @user_1') |
264 | const commentId = resComment.body.comment.id | 264 | const commentId = resComment.body.comment.id |
265 | 265 | ||
266 | await wait(500) | 266 | await waitJobs(servers) |
267 | await checkCommentMention(baseParams, uuid, commentId, threadId, 'super root name', 'presence') | 267 | await checkCommentMention(baseParams, uuid, commentId, threadId, 'super root name', 'presence') |
268 | }) | 268 | }) |
269 | 269 | ||