Initialise full project history for old projects (in background) when project opened (#4345)
Co-authored-by: Brian Gough <brian.gough@overleaf.com> GitOrigin-RevId: 2da493c6023b362ced197b0533fa684c654a3827
This commit is contained in:
committed by
Copybot
co-authored by
Brian Gough
parent
51546b29c4
commit
812b4b549f
@@ -54,6 +54,9 @@ describe('ProjectController', function () {
|
||||
.stub()
|
||||
.callsArgWith(2, null, { _id: this.project_id }),
|
||||
}
|
||||
this.ProjectHistoryHandler = {
|
||||
ensureHistoryExistsForProject: sinon.stub().callsArg(1),
|
||||
}
|
||||
this.SubscriptionLocator = { getUsersSubscription: sinon.stub() }
|
||||
this.LimitationsManager = { hasPaidSubscription: sinon.stub() }
|
||||
this.TagsHandler = { getAllTags: sinon.stub() }
|
||||
@@ -140,6 +143,7 @@ describe('ProjectController', function () {
|
||||
'./ProjectDeleter': this.ProjectDeleter,
|
||||
'./ProjectDuplicator': this.ProjectDuplicator,
|
||||
'./ProjectCreationHandler': this.ProjectCreationHandler,
|
||||
'./ProjectHistoryHandler': this.ProjectHistoryHandler,
|
||||
'../Editor/EditorController': this.EditorController,
|
||||
'../User/UserController': this.UserController,
|
||||
'./ProjectHelper': this.ProjectHelper,
|
||||
@@ -1024,6 +1028,18 @@ describe('ProjectController', function () {
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should ensureHistoryExistsForProject if saas and project_history enabled', function (done) {
|
||||
this.Features.hasFeature.withArgs('saas').returns(true)
|
||||
this.settings.apis.project_history = 'enabled'
|
||||
this.res.render = (pageName, opts) => {
|
||||
this.ProjectHistoryHandler.ensureHistoryExistsForProject
|
||||
.calledWith(this.project_id)
|
||||
.should.equal(true)
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should mark project as opened', function (done) {
|
||||
this.res.render = (pageName, opts) => {
|
||||
this.ProjectUpdateHandler.markAsOpened
|
||||
|
||||
Reference in New Issue
Block a user