Merge pull request #5348 from overleaf/ab-alpha-beta-properties

alpha and beta program user properties

GitOrigin-RevId: 633a61df83dd8206e780f67c85dd3403902f00f2
This commit is contained in:
Alexandre Bourdin
2021-10-05 15:38:53 +02:00
committed by Copybot
parent 4cecc6383a
commit 98db86b8f0
2 changed files with 32 additions and 0 deletions

View File

@@ -27,6 +27,9 @@ describe('BetaProgramHandler', function () {
updateUser: sinon.stub().resolves(),
},
}),
'../Analytics/AnalyticsManager': (this.AnalyticsManager = {
setUserPropertyForUser: sinon.stub().resolves(),
}),
},
})
})
@@ -47,6 +50,19 @@ describe('BetaProgramHandler', function () {
})
})
it('should set beta-program user property to true', function (done) {
this.call(err => {
expect(err).to.not.exist
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.user_id,
'beta-program',
true
)
done()
})
})
it('should not produce an error', function (done) {
this.call(err => {
expect(err).to.not.exist
@@ -85,6 +101,19 @@ describe('BetaProgramHandler', function () {
})
})
it('should set beta-program user property to false', function (done) {
this.call(err => {
expect(err).to.not.exist
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.user_id,
'beta-program',
false
)
done()
})
})
it('should not produce an error', function (done) {
this.call(err => {
expect(err).to.not.exist