diff options
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r-- | server/tests/api/check-params/users.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 28fefe79f..0fbc414c9 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -541,6 +541,28 @@ describe('Test users API validators', function () { | |||
541 | }) | 541 | }) |
542 | }) | 542 | }) |
543 | 543 | ||
544 | describe('When asking a password reset', function () { | ||
545 | const path = '/api/v1/users/ask-reset-password' | ||
546 | |||
547 | it('Should fail with a missing email', async function () { | ||
548 | const fields = {} | ||
549 | |||
550 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) | ||
551 | }) | ||
552 | |||
553 | it('Should fail with an invalid email', async function () { | ||
554 | const fields = { email: 'hello' } | ||
555 | |||
556 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) | ||
557 | }) | ||
558 | |||
559 | it('Should success with the correct params', async function () { | ||
560 | const fields = { email: 'admin@example.com' } | ||
561 | |||
562 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields, statusCodeExpected: 204 }) | ||
563 | }) | ||
564 | }) | ||
565 | |||
544 | after(async function () { | 566 | after(async function () { |
545 | killallServers([ server, serverWithRegistrationDisabled ]) | 567 | killallServers([ server, serverWithRegistrationDisabled ]) |
546 | 568 | ||