mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 13:21:37 +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:
@@ -21,8 +21,12 @@ describe('BetaProgramController', function () {
|
||||
user: this.user,
|
||||
},
|
||||
}
|
||||
this.SplitTestHandler = {
|
||||
sessionMaintenance: sinon.stub().yields(),
|
||||
}
|
||||
this.BetaProgramController = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'../SplitTests/SplitTestHandler': this.SplitTestHandler,
|
||||
'./BetaProgramHandler': (this.BetaProgramHandler = {
|
||||
optIn: sinon.stub(),
|
||||
optOut: sinon.stub(),
|
||||
@@ -68,6 +72,13 @@ describe('BetaProgramController', function () {
|
||||
this.BetaProgramHandler.optIn.callCount.should.equal(1)
|
||||
})
|
||||
|
||||
it('should invoke the session maintenance', function () {
|
||||
this.BetaProgramController.optIn(this.req, this.res, this.next)
|
||||
this.SplitTestHandler.sessionMaintenance.should.have.been.calledWith(
|
||||
this.req
|
||||
)
|
||||
})
|
||||
|
||||
describe('when BetaProgramHandler.opIn produces an error', function () {
|
||||
beforeEach(function () {
|
||||
this.BetaProgramHandler.optIn.callsArgWith(1, new Error('woops'))
|
||||
@@ -107,6 +118,13 @@ describe('BetaProgramController', function () {
|
||||
this.BetaProgramHandler.optOut.callCount.should.equal(1)
|
||||
})
|
||||
|
||||
it('should invoke the session maintenance', function () {
|
||||
this.BetaProgramController.optOut(this.req, this.res, this.next)
|
||||
this.SplitTestHandler.sessionMaintenance.should.have.been.calledWith(
|
||||
this.req
|
||||
)
|
||||
})
|
||||
|
||||
describe('when BetaProgramHandler.optOut produces an error', function () {
|
||||
beforeEach(function () {
|
||||
this.BetaProgramHandler.optOut.callsArgWith(1, new Error('woops'))
|
||||
|
||||
Reference in New Issue
Block a user