From 7590f7a8684c69c38d30dab68377720da16d2420 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 11:48:27 +0200 Subject: Add more tests on registration request conflict --- server/tests/api/check-params/registrations.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/registrations.ts b/server/tests/api/check-params/registrations.ts index fe16ebd93..8cbecdd07 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: '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', -- cgit v1.2.3