Skip to content

Commit

Permalink
testing with email as identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopezalvas committed Apr 3, 2024
1 parent e3de4ca commit 0cd3ca5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/api/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,20 @@ describeApi('Users', (request, { authenticated, token }) => {

describe('POST /password-recovery', () => {

test('Send email', async () => {
test('Send email - user identifier', async () => {
await request().post('/register').send({ ...userJson, username: 'TEST', email: '[email protected]' })
await request().post(`/password-recovery?userIdentifier=TEST`)
.expect(200)
.then(emailSent('Cambiar tu contraseña de Pilas Bloques'))
})

test('Send email - email identifier', async () => {
await request().post('/register').send({ ...userJson, username: 'TEST', email: '[email protected]' })
await request().post(`/[email protected]`)
.expect(200)
.then(emailSent('Cambiar tu contraseña de Pilas Bloques'))
})

test('Does not send email', async () => {
await request().post(`/password-recovery?userIdentifier=${username}`)
.expect(200)
Expand Down

0 comments on commit 0cd3ca5

Please sign in to comment.