|
|
@@ -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
|