diff --git a/services/web/app/src/Features/User/UserUpdater.js b/services/web/app/src/Features/User/UserUpdater.js index 108d1d9a4a..6e0dc27ebe 100644 --- a/services/web/app/src/Features/User/UserUpdater.js +++ b/services/web/app/src/Features/User/UserUpdater.js @@ -155,7 +155,7 @@ const UserUpdater = { if (res.n === 0) { return callback(new Error('Cannot remove email')) } - callback() + FeaturesUpdater.refreshFeatures(userId, callback) }) }) }, diff --git a/services/web/test/unit/src/User/UserUpdaterTests.js b/services/web/test/unit/src/User/UserUpdaterTests.js index fb79ea8797..ab12ccd5a2 100644 --- a/services/web/test/unit/src/User/UserUpdaterTests.js +++ b/services/web/test/unit/src/User/UserUpdaterTests.js @@ -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()