mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 06:23:46 +00:00
Merge pull request #2883 from overleaf/ta-email-remove-features-refresh
Refresh User's Features After Removing Email GitOrigin-RevId: 0085a5341a806d1d22f4a1fb5bb98c93675e242e
This commit is contained in:
parent
cab1335371
commit
74313e4b82
2 changed files with 13 additions and 1 deletions
|
@ -155,7 +155,7 @@ const UserUpdater = {
|
|||
if (res.n === 0) {
|
||||
return callback(new Error('Cannot remove email'))
|
||||
}
|
||||
callback()
|
||||
FeaturesUpdater.refreshFeatures(userId, callback)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
|
|
@ -293,6 +293,18 @@ describe('UserUpdater', function() {
|
|||
)
|
||||
})
|
||||
|
||||
it('refresh features', function(done) {
|
||||
this.UserUpdater.removeEmailAddress(
|
||||
this.stubbedUser._id,
|
||||
this.newEmail,
|
||||
err => {
|
||||
should.not.exist(err)
|
||||
sinon.assert.calledWith(this.refreshFeatures, this.stubbedUser._id)
|
||||
done()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('handle error', function(done) {
|
||||
this.UserUpdater.updateUser = sinon
|
||||
.stub()
|
||||
|
|
Loading…
Reference in a new issue