]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add more tests on registration request conflict
authorChocobozzz <me@florianbigard.com>
Wed, 10 May 2023 09:48:27 +0000 (11:48 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 10 May 2023 09:53:04 +0000 (11:53 +0200)
server/tests/api/check-params/registrations.ts

index fe16ebd93b23cd7eab1e94729e5cbbcbdeef86ea..8cbecdd07770f1813c784858d4d978a744579dcf 100644 (file)
@@ -254,7 +254,7 @@ describe('Test registrations API validators', function () {
         })
       })
 
-      it('Should fail if the user is already awaiting registration approval', async function () {
+      it('Should fail if the username is already awaiting registration approval', async function () {
         await server.registrations.requestRegistration({
           username: 'user_request_2',
           registrationReason: 'tt',
@@ -266,6 +266,19 @@ describe('Test registrations API validators', function () {
         })
       })
 
+      it('Should fail if the email is already awaiting registration approval', async function () {
+        await server.registrations.requestRegistration({
+          username: 'user42',
+          email: 'user_request_2@example.com',
+          registrationReason: 'tt',
+          channel: {
+            displayName: 'my user request 42 channel',
+            name: 'user_request_42_channel'
+          },
+          expectedStatus: HttpStatusCode.CONFLICT_409
+        })
+      })
+
       it('Should fail if the channel is already awaiting registration approval', async function () {
         await server.registrations.requestRegistration({
           username: 'user42',