aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications/moderation-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-13 14:23:01 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (patch)
tree7a166515e4d57a06eb3c08be569f106ed049988b /server/tests/api/notifications/moderation-notifications.ts
parentd0a0fa429d4651710ed951a3c11af0219e408964 (diff)
downloadPeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.gz
PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.tar.zst
PeerTube-7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0.zip
Introduce user command
Diffstat (limited to 'server/tests/api/notifications/moderation-notifications.ts')
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 99b434606..0269124c5 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -17,13 +17,10 @@ import {
17 checkVideoAutoBlacklistForModerators, 17 checkVideoAutoBlacklistForModerators,
18 checkVideoIsPublished, 18 checkVideoIsPublished,
19 cleanupTests, 19 cleanupTests,
20 createUser,
21 generateUserAccessToken,
22 getVideoIdFromUUID, 20 getVideoIdFromUUID,
23 MockInstancesIndex, 21 MockInstancesIndex,
24 MockSmtpServer, 22 MockSmtpServer,
25 prepareNotificationsTest, 23 prepareNotificationsTest,
26 registerUser,
27 ServerInfo, 24 ServerInfo,
28 uploadVideo, 25 uploadVideo,
29 wait, 26 wait,
@@ -139,8 +136,8 @@ describe('Test moderation notifications', function () {
139 this.timeout(20000) 136 this.timeout(20000)
140 137
141 const username = 'user' + new Date().getTime() 138 const username = 'user' + new Date().getTime()
142 const resUser = await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username, password: 'donald' }) 139 const { account } = await servers[0].usersCommand.create({ username, password: 'donald' })
143 const accountId = resUser.body.user.account.id 140 const accountId = account.id
144 141
145 await servers[0].abusesCommand.report({ accountId, reason: 'super reason' }) 142 await servers[0].abusesCommand.report({ accountId, reason: 'super reason' })
146 143
@@ -152,7 +149,7 @@ describe('Test moderation notifications', function () {
152 this.timeout(20000) 149 this.timeout(20000)
153 150
154 const username = 'user' + new Date().getTime() 151 const username = 'user' + new Date().getTime()
155 const tmpToken = await generateUserAccessToken(servers[0], username) 152 const tmpToken = await servers[0].usersCommand.generateUserAndToken(username)
156 await uploadVideo(servers[0].url, tmpToken, { name: 'super video' }) 153 await uploadVideo(servers[0].url, tmpToken, { name: 'super video' })
157 154
158 await waitJobs(servers) 155 await waitJobs(servers)
@@ -339,7 +336,7 @@ describe('Test moderation notifications', function () {
339 it('Should send a notification only to moderators when a user registers on the instance', async function () { 336 it('Should send a notification only to moderators when a user registers on the instance', async function () {
340 this.timeout(10000) 337 this.timeout(10000)
341 338
342 await registerUser(servers[0].url, 'user_45', 'password') 339 await servers[0].usersCommand.register({ username: 'user_45' })
343 340
344 await waitJobs(servers) 341 await waitJobs(servers)
345 342