aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/moderation
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-22 09:20:28 +0200
committerChocobozzz <me@florianbigard.com>2023-05-22 09:22:08 +0200
commit33b91e53d21fba295ecf516b717fb36e91990771 (patch)
treec3e6c31636a47b64c164c1e91ee2125bbc61339e /server/tests/api/moderation
parent679f8800cdc0ef925fae9ca26fb2892a8f475ad5 (diff)
downloadPeerTube-33b91e53d21fba295ecf516b717fb36e91990771.tar.gz
PeerTube-33b91e53d21fba295ecf516b717fb36e91990771.tar.zst
PeerTube-33b91e53d21fba295ecf516b717fb36e91990771.zip
Remove low timeouts
Default timeout is 30s
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r--server/tests/api/moderation/abuses.ts26
-rw-r--r--server/tests/api/moderation/blocklist-notification.ts8
-rw-r--r--server/tests/api/moderation/blocklist.ts4
3 files changed, 0 insertions, 38 deletions
diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.ts
index d9c164c43..9fc296ea8 100644
--- a/server/tests/api/moderation/abuses.ts
+++ b/server/tests/api/moderation/abuses.ts
@@ -124,8 +124,6 @@ describe('Test abuses', function () {
124 }) 124 })
125 125
126 it('Should report abuse on a remote video', async function () { 126 it('Should report abuse on a remote video', async function () {
127 this.timeout(10000)
128
129 const reason = 'my super bad reason 2' 127 const reason = 'my super bad reason 2'
130 const videoId = await servers[0].videos.getId({ uuid: servers[1].store.videoCreated.uuid }) 128 const videoId = await servers[0].videos.getId({ uuid: servers[1].store.videoCreated.uuid })
131 await commands[0].report({ videoId, reason }) 129 await commands[0].report({ videoId, reason })
@@ -197,8 +195,6 @@ describe('Test abuses', function () {
197 }) 195 })
198 196
199 it('Should hide video abuses from blocked accounts', async function () { 197 it('Should hide video abuses from blocked accounts', async function () {
200 this.timeout(10000)
201
202 { 198 {
203 const videoId = await servers[1].videos.getId({ uuid: servers[0].store.videoCreated.uuid }) 199 const videoId = await servers[1].videos.getId({ uuid: servers[0].store.videoCreated.uuid })
204 await commands[1].report({ videoId, reason: 'will mute this' }) 200 await commands[1].report({ videoId, reason: 'will mute this' })
@@ -250,8 +246,6 @@ describe('Test abuses', function () {
250 }) 246 })
251 247
252 it('Should keep the video abuse when deleting the video', async function () { 248 it('Should keep the video abuse when deleting the video', async function () {
253 this.timeout(10000)
254
255 await servers[1].videos.remove({ id: abuseServer2.video.uuid }) 249 await servers[1].videos.remove({ id: abuseServer2.video.uuid })
256 250
257 await waitJobs(servers) 251 await waitJobs(servers)
@@ -268,8 +262,6 @@ describe('Test abuses', function () {
268 }) 262 })
269 263
270 it('Should include counts of reports from reporter and reportee', async function () { 264 it('Should include counts of reports from reporter and reportee', async function () {
271 this.timeout(10000)
272
273 // register a second user to have two reporters/reportees 265 // register a second user to have two reporters/reportees
274 const user = { username: 'user2', password: 'password' } 266 const user = { username: 'user2', password: 'password' }
275 await servers[0].users.create({ ...user }) 267 await servers[0].users.create({ ...user })
@@ -307,8 +299,6 @@ describe('Test abuses', function () {
307 }) 299 })
308 300
309 it('Should list predefined reasons as well as timestamps for the reported video', async function () { 301 it('Should list predefined reasons as well as timestamps for the reported video', async function () {
310 this.timeout(10000)
311
312 const reason5 = 'my super bad reason 5' 302 const reason5 = 'my super bad reason 5'
313 const predefinedReasons5: AbusePredefinedReasonsString[] = [ 'violentOrRepulsive', 'captions' ] 303 const predefinedReasons5: AbusePredefinedReasonsString[] = [ 'violentOrRepulsive', 'captions' ]
314 const createRes = await commands[0].report({ 304 const createRes = await commands[0].report({
@@ -331,8 +321,6 @@ describe('Test abuses', function () {
331 }) 321 })
332 322
333 it('Should delete the video abuse', async function () { 323 it('Should delete the video abuse', async function () {
334 this.timeout(10000)
335
336 await commands[1].delete({ abuseId: abuseServer2.id }) 324 await commands[1].delete({ abuseId: abuseServer2.id })
337 325
338 await waitJobs(servers) 326 await waitJobs(servers)
@@ -351,8 +339,6 @@ describe('Test abuses', function () {
351 }) 339 })
352 340
353 it('Should list and filter video abuses', async function () { 341 it('Should list and filter video abuses', async function () {
354 this.timeout(10000)
355
356 async function list (query: Parameters<AbusesCommand['getAdminList']>[0]) { 342 async function list (query: Parameters<AbusesCommand['getAdminList']>[0]) {
357 const body = await commands[0].getAdminList(query) 343 const body = await commands[0].getAdminList(query)
358 344
@@ -457,8 +443,6 @@ describe('Test abuses', function () {
457 }) 443 })
458 444
459 it('Should report abuse on a remote comment', async function () { 445 it('Should report abuse on a remote comment', async function () {
460 this.timeout(10000)
461
462 const comment = await getComment(servers[0], servers[1].store.videoCreated.uuid) 446 const comment = await getComment(servers[0], servers[1].store.videoCreated.uuid)
463 447
464 const reason = 'it is a really bad comment' 448 const reason = 'it is a really bad comment'
@@ -525,8 +509,6 @@ describe('Test abuses', function () {
525 }) 509 })
526 510
527 it('Should keep the comment abuse when deleting the comment', async function () { 511 it('Should keep the comment abuse when deleting the comment', async function () {
528 this.timeout(10000)
529
530 const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.uuid) 512 const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.uuid)
531 513
532 await servers[0].comments.delete({ videoId: servers[1].store.videoCreated.uuid, commentId: commentServer2.id }) 514 await servers[0].comments.delete({ videoId: servers[1].store.videoCreated.uuid, commentId: commentServer2.id })
@@ -546,8 +528,6 @@ describe('Test abuses', function () {
546 }) 528 })
547 529
548 it('Should delete the comment abuse', async function () { 530 it('Should delete the comment abuse', async function () {
549 this.timeout(10000)
550
551 await commands[1].delete({ abuseId: abuseServer2.id }) 531 await commands[1].delete({ abuseId: abuseServer2.id })
552 532
553 await waitJobs(servers) 533 await waitJobs(servers)
@@ -645,8 +625,6 @@ describe('Test abuses', function () {
645 }) 625 })
646 626
647 it('Should report abuse on a remote account', async function () { 627 it('Should report abuse on a remote account', async function () {
648 this.timeout(10000)
649
650 const account = await getAccountFromServer(servers[0], 'user_2', servers[1]) 628 const account = await getAccountFromServer(servers[0], 'user_2', servers[1])
651 629
652 const reason = 'it is a really bad account' 630 const reason = 'it is a really bad account'
@@ -699,8 +677,6 @@ describe('Test abuses', function () {
699 }) 677 })
700 678
701 it('Should keep the account abuse when deleting the account', async function () { 679 it('Should keep the account abuse when deleting the account', async function () {
702 this.timeout(10000)
703
704 const account = await getAccountFromServer(servers[1], 'user_2', servers[1]) 680 const account = await getAccountFromServer(servers[1], 'user_2', servers[1])
705 await servers[1].users.remove({ userId: account.userId }) 681 await servers[1].users.remove({ userId: account.userId })
706 682
@@ -715,8 +691,6 @@ describe('Test abuses', function () {
715 }) 691 })
716 692
717 it('Should delete the account abuse', async function () { 693 it('Should delete the account abuse', async function () {
718 this.timeout(10000)
719
720 await commands[1].delete({ abuseId: abuseServer2.id }) 694 await commands[1].delete({ abuseId: abuseServer2.id })
721 695
722 await waitJobs(servers) 696 await waitJobs(servers)
diff --git a/server/tests/api/moderation/blocklist-notification.ts b/server/tests/api/moderation/blocklist-notification.ts
index eb092a1df..9c2863a58 100644
--- a/server/tests/api/moderation/blocklist-notification.ts
+++ b/server/tests/api/moderation/blocklist-notification.ts
@@ -113,8 +113,6 @@ describe('Test blocklist notifications', function () {
113 }) 113 })
114 114
115 it('Should block an account', async function () { 115 it('Should block an account', async function () {
116 this.timeout(10000)
117
118 await servers[0].blocklist.addToMyBlocklist({ token: userToken1, account: 'user3@' + servers[1].host }) 116 await servers[0].blocklist.addToMyBlocklist({ token: userToken1, account: 'user3@' + servers[1].host })
119 await waitJobs(servers) 117 await waitJobs(servers)
120 }) 118 })
@@ -146,8 +144,6 @@ describe('Test blocklist notifications', function () {
146 }) 144 })
147 145
148 it('Should block an account', async function () { 146 it('Should block an account', async function () {
149 this.timeout(10000)
150
151 await servers[0].blocklist.addToMyBlocklist({ token: userToken1, server: servers[1].host }) 147 await servers[0].blocklist.addToMyBlocklist({ token: userToken1, server: servers[1].host })
152 await waitJobs(servers) 148 await waitJobs(servers)
153 }) 149 })
@@ -186,8 +182,6 @@ describe('Test blocklist notifications', function () {
186 }) 182 })
187 183
188 it('Should block an account', async function () { 184 it('Should block an account', async function () {
189 this.timeout(10000)
190
191 await servers[0].blocklist.addToServerBlocklist({ account: 'user3@' + servers[1].host }) 185 await servers[0].blocklist.addToServerBlocklist({ account: 'user3@' + servers[1].host })
192 await waitJobs(servers) 186 await waitJobs(servers)
193 }) 187 })
@@ -221,8 +215,6 @@ describe('Test blocklist notifications', function () {
221 }) 215 })
222 216
223 it('Should block an account', async function () { 217 it('Should block an account', async function () {
224 this.timeout(10000)
225
226 await servers[0].blocklist.addToServerBlocklist({ server: servers[1].host }) 218 await servers[0].blocklist.addToServerBlocklist({ server: servers[1].host })
227 await waitJobs(servers) 219 await waitJobs(servers)
228 }) 220 })
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts
index 47d29e7f8..b90d8c16c 100644
--- a/server/tests/api/moderation/blocklist.ts
+++ b/server/tests/api/moderation/blocklist.ts
@@ -439,8 +439,6 @@ describe('Test blocklist', function () {
439 }) 439 })
440 440
441 it('Should hide its comments', async function () { 441 it('Should hide its comments', async function () {
442 this.timeout(10000)
443
444 const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' }) 442 const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' })
445 443
446 await waitJobs(servers) 444 await waitJobs(servers)
@@ -767,8 +765,6 @@ describe('Test blocklist', function () {
767 }) 765 })
768 766
769 it('Should hide its comments', async function () { 767 it('Should hide its comments', async function () {
770 this.timeout(10000)
771
772 const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' }) 768 const { id } = await commentsCommand[1].createThread({ token: userToken2, videoId: videoUUID1, text: 'hidden comment 2' })
773 769
774 await waitJobs(servers) 770 await waitJobs(servers)