diff options
Diffstat (limited to 'server/tests/api/notifications')
-rw-r--r-- | server/tests/api/notifications/moderation-notifications.ts | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts index b127a7a31..c7b9b5fb0 100644 --- a/server/tests/api/notifications/moderation-notifications.ts +++ b/server/tests/api/notifications/moderation-notifications.ts | |||
@@ -34,7 +34,7 @@ describe('Test moderation notifications', function () { | |||
34 | let emails: object[] = [] | 34 | let emails: object[] = [] |
35 | 35 | ||
36 | before(async function () { | 36 | before(async function () { |
37 | this.timeout(120000) | 37 | this.timeout(50000) |
38 | 38 | ||
39 | const res = await prepareNotificationsTest(3) | 39 | const res = await prepareNotificationsTest(3) |
40 | emails = res.emails | 40 | emails = res.emails |
@@ -60,7 +60,7 @@ describe('Test moderation notifications', function () { | |||
60 | }) | 60 | }) |
61 | 61 | ||
62 | it('Should not send a notification to moderators on local abuse reported by an admin', async function () { | 62 | it('Should not send a notification to moderators on local abuse reported by an admin', async function () { |
63 | this.timeout(20000) | 63 | this.timeout(50000) |
64 | 64 | ||
65 | const name = 'video for abuse ' + buildUUID() | 65 | const name = 'video for abuse ' + buildUUID() |
66 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) | 66 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) |
@@ -72,7 +72,7 @@ describe('Test moderation notifications', function () { | |||
72 | }) | 72 | }) |
73 | 73 | ||
74 | it('Should send a notification to moderators on local video abuse', async function () { | 74 | it('Should send a notification to moderators on local video abuse', async function () { |
75 | this.timeout(20000) | 75 | this.timeout(50000) |
76 | 76 | ||
77 | const name = 'video for abuse ' + buildUUID() | 77 | const name = 'video for abuse ' + buildUUID() |
78 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) | 78 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) |
@@ -84,7 +84,7 @@ describe('Test moderation notifications', function () { | |||
84 | }) | 84 | }) |
85 | 85 | ||
86 | it('Should send a notification to moderators on remote video abuse', async function () { | 86 | it('Should send a notification to moderators on remote video abuse', async function () { |
87 | this.timeout(20000) | 87 | this.timeout(50000) |
88 | 88 | ||
89 | const name = 'video for abuse ' + buildUUID() | 89 | const name = 'video for abuse ' + buildUUID() |
90 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) | 90 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) |
@@ -99,7 +99,7 @@ describe('Test moderation notifications', function () { | |||
99 | }) | 99 | }) |
100 | 100 | ||
101 | it('Should send a notification to moderators on local comment abuse', async function () { | 101 | it('Should send a notification to moderators on local comment abuse', async function () { |
102 | this.timeout(20000) | 102 | this.timeout(50000) |
103 | 103 | ||
104 | const name = 'video for abuse ' + buildUUID() | 104 | const name = 'video for abuse ' + buildUUID() |
105 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) | 105 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) |
@@ -118,7 +118,7 @@ describe('Test moderation notifications', function () { | |||
118 | }) | 118 | }) |
119 | 119 | ||
120 | it('Should send a notification to moderators on remote comment abuse', async function () { | 120 | it('Should send a notification to moderators on remote comment abuse', async function () { |
121 | this.timeout(20000) | 121 | this.timeout(50000) |
122 | 122 | ||
123 | const name = 'video for abuse ' + buildUUID() | 123 | const name = 'video for abuse ' + buildUUID() |
124 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) | 124 | const video = await servers[0].videos.upload({ token: userToken1, attributes: { name } }) |
@@ -140,7 +140,7 @@ describe('Test moderation notifications', function () { | |||
140 | }) | 140 | }) |
141 | 141 | ||
142 | it('Should send a notification to moderators on local account abuse', async function () { | 142 | it('Should send a notification to moderators on local account abuse', async function () { |
143 | this.timeout(20000) | 143 | this.timeout(50000) |
144 | 144 | ||
145 | const username = 'user' + new Date().getTime() | 145 | const username = 'user' + new Date().getTime() |
146 | const { account } = await servers[0].users.create({ username, password: 'donald' }) | 146 | const { account } = await servers[0].users.create({ username, password: 'donald' }) |
@@ -153,7 +153,7 @@ describe('Test moderation notifications', function () { | |||
153 | }) | 153 | }) |
154 | 154 | ||
155 | it('Should send a notification to moderators on remote account abuse', async function () { | 155 | it('Should send a notification to moderators on remote account abuse', async function () { |
156 | this.timeout(20000) | 156 | this.timeout(50000) |
157 | 157 | ||
158 | const username = 'user' + new Date().getTime() | 158 | const username = 'user' + new Date().getTime() |
159 | const tmpToken = await servers[0].users.generateUserAndToken(username) | 159 | const tmpToken = await servers[0].users.generateUserAndToken(username) |
@@ -512,10 +512,14 @@ describe('Test moderation notifications', function () { | |||
512 | }) | 512 | }) |
513 | 513 | ||
514 | it('Should not send video publish notification if auto-blacklisted', async function () { | 514 | it('Should not send video publish notification if auto-blacklisted', async function () { |
515 | this.timeout(120000) | ||
516 | |||
515 | await checkVideoIsPublished({ ...userBaseParams, videoName, shortUUID, checkType: 'absence' }) | 517 | await checkVideoIsPublished({ ...userBaseParams, videoName, shortUUID, checkType: 'absence' }) |
516 | }) | 518 | }) |
517 | 519 | ||
518 | it('Should not send a local user subscription notification if auto-blacklisted', async function () { | 520 | it('Should not send a local user subscription notification if auto-blacklisted', async function () { |
521 | this.timeout(120000) | ||
522 | |||
519 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer1, videoName, shortUUID, checkType: 'absence' }) | 523 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer1, videoName, shortUUID, checkType: 'absence' }) |
520 | }) | 524 | }) |
521 | 525 | ||
@@ -524,7 +528,7 @@ describe('Test moderation notifications', function () { | |||
524 | }) | 528 | }) |
525 | 529 | ||
526 | it('Should send video published and unblacklist after video unblacklisted', async function () { | 530 | it('Should send video published and unblacklist after video unblacklisted', async function () { |
527 | this.timeout(40000) | 531 | this.timeout(120000) |
528 | 532 | ||
529 | await servers[0].blacklist.remove({ videoId: uuid }) | 533 | await servers[0].blacklist.remove({ videoId: uuid }) |
530 | 534 | ||
@@ -537,10 +541,14 @@ describe('Test moderation notifications', function () { | |||
537 | }) | 541 | }) |
538 | 542 | ||
539 | it('Should send a local user subscription notification after removed from blacklist', async function () { | 543 | it('Should send a local user subscription notification after removed from blacklist', async function () { |
544 | this.timeout(120000) | ||
545 | |||
540 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer1, videoName, shortUUID, checkType: 'presence' }) | 546 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer1, videoName, shortUUID, checkType: 'presence' }) |
541 | }) | 547 | }) |
542 | 548 | ||
543 | it('Should send a remote user subscription notification after removed from blacklist', async function () { | 549 | it('Should send a remote user subscription notification after removed from blacklist', async function () { |
550 | this.timeout(120000) | ||
551 | |||
544 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer2, videoName, shortUUID, checkType: 'presence' }) | 552 | await checkNewVideoFromSubscription({ ...adminBaseParamsServer2, videoName, shortUUID, checkType: 'presence' }) |
545 | }) | 553 | }) |
546 | 554 | ||
@@ -576,7 +584,7 @@ describe('Test moderation notifications', function () { | |||
576 | }) | 584 | }) |
577 | 585 | ||
578 | it('Should not send publish/subscription notifications after scheduled update if video still auto-blacklisted', async function () { | 586 | it('Should not send publish/subscription notifications after scheduled update if video still auto-blacklisted', async function () { |
579 | this.timeout(40000) | 587 | this.timeout(120000) |
580 | 588 | ||
581 | // In 2 seconds | 589 | // In 2 seconds |
582 | const updateAt = new Date(new Date().getTime() + 2000) | 590 | const updateAt = new Date(new Date().getTime() + 2000) |