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:
Jakob Ackermann
2023-09-13 13:07:00 +02:00
committed by Copybot
parent 7d3c8fb78d
commit 1e4dcc84d9
8 changed files with 99 additions and 3 deletions
@@ -102,6 +102,7 @@ describe('ProjectListController', function () {
}
this.SplitTestHandler = {
promises: {
sessionMaintenance: sinon.stub().resolves(),
getAssignment: sinon.stub().resolves({ variant: 'default' }),
},
}
@@ -204,6 +205,18 @@ describe('ProjectListController', function () {
this.ProjectListController.projectListPage(this.req, this.res)
})
it('should invoke the session maintenance', function (done) {
this.Features.hasFeature.withArgs('saas').returns(true)
this.res.render = () => {
this.SplitTestHandler.promises.sessionMaintenance.should.have.been.calledWith(
this.req,
this.user
)
done()
}
this.ProjectListController.projectListPage(this.req, this.res)
})
it('should send the tags', function (done) {
this.res.render = (pageName, opts) => {
opts.tags.length.should.equal(this.tags.length)