aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-01-20 15:34:01 +0100
committerChocobozzz <me@florianbigard.com>2023-01-20 15:34:01 +0100
commit4115f20084f302f497be9cb12237564679ca54ec (patch)
tree74cf8f5b3884edeb0b47b529cf04b306cd12b23d /server/tests/api
parente854d57bed56bcbba4d191af54125ae6dd569a88 (diff)
downloadPeerTube-4115f20084f302f497be9cb12237564679ca54ec.tar.gz
PeerTube-4115f20084f302f497be9cb12237564679ca54ec.tar.zst
PeerTube-4115f20084f302f497be9cb12237564679ca54ec.zip
Add ability to not send an email for registration
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/users/registrations.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/tests/api/users/registrations.ts b/server/tests/api/users/registrations.ts
index a9e1114e8..e6524f07d 100644
--- a/server/tests/api/users/registrations.ts
+++ b/server/tests/api/users/registrations.ts
@@ -329,6 +329,42 @@ describe('Test registrations', function () {
329 } 329 }
330 }) 330 })
331 331
332 it('Should be able to prevent email delivery on accept/reject', async function () {
333 this.timeout(50000)
334
335 let id1: number
336 let id2: number
337
338 {
339 const { id } = await server.registrations.requestRegistration({
340 username: 'user7',
341 email: 'user7@example.com',
342 registrationReason: 'tt'
343 })
344 id1 = id
345 }
346 {
347 const { id } = await server.registrations.requestRegistration({
348 username: 'user8',
349 email: 'user8@example.com',
350 registrationReason: 'tt'
351 })
352 id2 = id
353 }
354
355 await server.registrations.accept({ id: id1, moderationResponse: 'tt', preventEmailDelivery: true })
356 await server.registrations.reject({ id: id2, moderationResponse: 'tt', preventEmailDelivery: true })
357
358 await waitJobs([ server ])
359
360 const filtered = emails.filter(e => {
361 const address = e['to'][0]['address']
362 return address === 'user7@example.com' || address === 'user8@example.com'
363 })
364
365 expect(filtered).to.have.lengthOf(0)
366 })
367
332 it('Should request a registration without a channel, that will conflict with an already existing channel', async function () { 368 it('Should request a registration without a channel, that will conflict with an already existing channel', async function () {
333 let id1: number 369 let id1: number
334 let id2: number 370 let id2: number