mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #17730 from overleaf/rh-acct-delete-email
[web] Send email notification on account deletion GitOrigin-RevId: 03c0effba0ee3b829f5b4fe377fe67d05776ba3f
This commit is contained in:
@@ -100,6 +100,12 @@ describe('UserDeleter', function () {
|
||||
deleteOnboardingDataCollection: sinon.stub().resolves(),
|
||||
}
|
||||
|
||||
this.EmailHandler = {
|
||||
promises: {
|
||||
sendEmail: sinon.stub().resolves(),
|
||||
},
|
||||
}
|
||||
|
||||
this.UserDeleter = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'../../models/User': { User },
|
||||
@@ -119,6 +125,7 @@ describe('UserDeleter', function () {
|
||||
'../../infrastructure/Modules': this.Modules,
|
||||
'../OnboardingDataCollection/OnboardingDataCollectionManager':
|
||||
this.OnboardingDataCollectionManager,
|
||||
'../Email/EmailHandler': this.EmailHandler,
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -251,6 +258,16 @@ describe('UserDeleter', function () {
|
||||
await this.UserDeleter.promises.deleteUser(this.userId, {})
|
||||
this.DeletedUserMock.verify()
|
||||
})
|
||||
|
||||
it('should email the user', async function () {
|
||||
await this.UserDeleter.promises.deleteUser(this.userId, {})
|
||||
const emailOptions = {
|
||||
to: 'bob@bob.com',
|
||||
}
|
||||
expect(
|
||||
this.EmailHandler.promises.sendEmail
|
||||
).to.have.been.calledWith('deletedAccount', emailOptions)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when unsubscribing from mailchimp fails', function () {
|
||||
|
||||
Reference in New Issue
Block a user