Merge pull request #5107 from overleaf/jk-de-ng-reconfirm-and-pw-reset

[web] de-ng password reset and must-reconfirm forms

GitOrigin-RevId: 2101493ff017ba56214c6f981129f94eb9db46aa
This commit is contained in:
June Kelly
2021-09-17 08:03:02 +00:00
committed by Copybot
parent 53698fb980
commit 0ae8f37629
4 changed files with 35 additions and 28 deletions
@@ -68,6 +68,9 @@ describe('PasswordResetController', function () {
})
describe('requestReset', function () {
beforeEach(function () {
this.res.json = sinon.stub()
})
it('should tell the handler to process that email', function (done) {
this.PasswordResetHandler.generateAndEmailResetToken.callsArgWith(
1,
@@ -79,6 +82,7 @@ describe('PasswordResetController', function () {
.calledWith(this.email)
.should.equal(true)
this.res.statusCode.should.equal(200)
this.res.json.calledWith(sinon.match.has('message')).should.equal(true)
done()
})
@@ -101,6 +105,7 @@ describe('PasswordResetController', function () {
)
this.PasswordResetController.requestReset(this.req, this.res)
this.res.statusCode.should.equal(404)
this.res.json.calledWith(sinon.match.has('message')).should.equal(true)
done()
})
@@ -112,6 +117,7 @@ describe('PasswordResetController', function () {
)
this.PasswordResetController.requestReset(this.req, this.res)
this.res.statusCode.should.equal(404)
this.res.json.calledWith(sinon.match.has('message')).should.equal(true)
done()
})
@@ -128,6 +134,7 @@ describe('PasswordResetController', function () {
.calledWith(this.email.toLowerCase().trim())
.should.equal(true)
this.res.statusCode.should.equal(200)
this.res.json.calledWith(sinon.match.has('message')).should.equal(true)
done()
})
})