mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #2504 from overleaf/bg-initialise-history-on-open
create v2 history for old projects when opened GitOrigin-RevId: 78229b517cb425bc439efca1b9259b472099db6d
This commit is contained in:
@@ -56,6 +56,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() }
|
||||
@@ -157,6 +160,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,
|
||||
@@ -1133,6 +1137,16 @@ describe('ProjectController', function() {
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should ensureHistoryExistsForProject', function(done) {
|
||||
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