Send delete request to chat when expiring deleted projects (#6997)
* Send delete request to chat when expiring deleted projects * Add script to clean-up orphaned chat of previously expired projects GitOrigin-RevId: 157d100bd51b6204a9e31733b5164b8e7036ef01
This commit is contained in:
@@ -135,6 +135,11 @@ describe('ProjectDeleter', function () {
|
||||
this.Features = {
|
||||
hasFeature: sinon.stub().returns(true),
|
||||
}
|
||||
this.ChatApiHandler = {
|
||||
promises: {
|
||||
destroyProject: sinon.stub().resolves(),
|
||||
},
|
||||
}
|
||||
|
||||
this.ProjectDeleter = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
@@ -148,6 +153,7 @@ describe('ProjectDeleter', function () {
|
||||
'../Tags/TagsHandler': this.TagsHandler,
|
||||
'../FileStore/FileStoreHandler': this.FileStoreHandler,
|
||||
'../ThirdPartyDataStore/TpdsUpdateSender': this.TpdsUpdateSender,
|
||||
'../Chat/ChatApiHandler': this.ChatApiHandler,
|
||||
'../Collaborators/CollaboratorsHandler': this.CollaboratorsHandler,
|
||||
'../Collaborators/CollaboratorsGetter': this.CollaboratorsGetter,
|
||||
'../Docstore/DocstoreManager': this.DocstoreManager,
|
||||
@@ -488,6 +494,12 @@ describe('ProjectDeleter', function () {
|
||||
project_id: this.deletedProjects[0].project._id,
|
||||
})
|
||||
})
|
||||
|
||||
it('should destroy the chat threads and messages', function () {
|
||||
expect(
|
||||
this.ChatApiHandler.promises.destroyProject
|
||||
).to.have.been.calledWith(this.deletedProjects[0].project._id)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when history-v1 is not available', function () {
|
||||
@@ -577,6 +589,11 @@ describe('ProjectDeleter', function () {
|
||||
expect(this.TpdsUpdateSender.promises.deleteProject).to.not.have.been
|
||||
.called
|
||||
})
|
||||
|
||||
it('should not destroy the chat threads and messages', function () {
|
||||
expect(this.ChatApiHandler.promises.destroyProject).to.not.have.been
|
||||
.called
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user