mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
Merge pull request #14803 from overleaf/jpa-split-test-cache-alpha-beta
[web] invalidate split test cache when alpha/beta program status changes GitOrigin-RevId: 3023d2adf8466b48490c51497f5c80e7b0a1fe3d
This commit is contained in:
@@ -128,6 +128,7 @@ describe('ProjectController', function () {
|
||||
getAssignment: sinon.stub().resolves({ variant: 'default' }),
|
||||
},
|
||||
getAssignment: sinon.stub().yields(null, { variant: 'default' }),
|
||||
sessionMaintenance: sinon.stub().yields(),
|
||||
}
|
||||
this.InstitutionsFeatures = {
|
||||
hasLicence: sinon.stub().callsArgWith(1, null, false),
|
||||
@@ -515,6 +516,28 @@ describe('ProjectController', function () {
|
||||
return this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should invoke the session maintenance for logged in user', function (done) {
|
||||
this.res.render = () => {
|
||||
this.SplitTestHandler.sessionMaintenance.should.have.been.calledWith(
|
||||
this.req,
|
||||
this.user
|
||||
)
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should invoke the session maintenance for anonymous user', function (done) {
|
||||
this.SessionManager.getLoggedInUserId.returns(null)
|
||||
this.res.render = () => {
|
||||
this.SplitTestHandler.sessionMaintenance.should.have.been.calledWith(
|
||||
this.req
|
||||
)
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should render the closed page if the editor is closed', function (done) {
|
||||
this.settings.editorIsOpen = false
|
||||
this.res.render = (pageName, opts) => {
|
||||
|
||||
Reference in New Issue
Block a user