Add more tests on registration request conflict

pull/5817/head
Chocobozzz 2023-05-10 11:48:27 +02:00
parent 89fc014262
commit 7590f7a868
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 14 additions and 1 deletions

View 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',