mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix tests
This commit is contained in:
parent
5446ca80dc
commit
65ba80b5a3
1 changed files with 19 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Job } from 'bullmq'
|
||||
import { Job, Queue } from 'bullmq'
|
||||
import chai, { expect } from 'chai'
|
||||
import sinon from 'sinon'
|
||||
import sinonChai from 'sinon-chai'
|
||||
|
|
@ -372,7 +372,11 @@ describe('auth router', () => {
|
|||
|
||||
context('when reset password email sent', () => {
|
||||
before(() => {
|
||||
sinon.replace(createTask, 'enqueueSendEmail', sinon.fake())
|
||||
sinon.replace(
|
||||
createTask,
|
||||
'enqueueSendEmail',
|
||||
sinon.fake.resolves(new Job(new Queue('test'), 'test', 'test'))
|
||||
)
|
||||
})
|
||||
|
||||
after(() => {
|
||||
|
|
@ -426,6 +430,19 @@ describe('auth router', () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('when email is empty', () => {
|
||||
before(() => {
|
||||
email = ''
|
||||
})
|
||||
|
||||
it('redirects to forgot-password page with error code INVALID_EMAIL', async () => {
|
||||
const res = await emailResetPasswordReq(email).expect(302)
|
||||
expect(res.header.location).to.endWith(
|
||||
'/forgot-password?errorCodes=INVALID_EMAIL'
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('reset-password', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue