Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add more tests on registration request conflict

Chocobozzz7590f7a8684c
diff --git a/server/tests/api/check-params/registrations.ts b/server/tests/api/check-params/registrations.ts
index fe16ebd93b..8cbecdd077 100644
--- a/server/tests/api/check-params/registrations.ts
+++ b/server/tests/api/check-params/registrations.ts
@@ -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: '[email protected]',
+ 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',