mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #34976 from overleaf/rh-cio-beta-program
Expose beta program participation to Customer.io GitOrigin-RevId: e28d9b41afb2e50e62b7e06c94482f4240c6becc
This commit is contained in:
@@ -39,6 +39,16 @@ describe('BetaProgramHandler', function () {
|
||||
})
|
||||
)
|
||||
|
||||
vi.doMock('../../../../app/src/infrastructure/Modules', () => ({
|
||||
default: (ctx.Modules = {
|
||||
promises: {
|
||||
hooks: {
|
||||
fire: sinon.stub().resolves(),
|
||||
},
|
||||
},
|
||||
}),
|
||||
}))
|
||||
|
||||
ctx.session = {}
|
||||
ctx.handler = (await import(modulePath)).default
|
||||
})
|
||||
@@ -76,6 +86,21 @@ describe('BetaProgramHandler', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('should set beta_program=true user property in customer.io', async function (ctx) {
|
||||
await new Promise(resolve => {
|
||||
ctx.call(err => {
|
||||
expect(err).to.not.exist
|
||||
sinon.assert.calledWith(
|
||||
ctx.Modules.promises.hooks.fire,
|
||||
'setUserProperties',
|
||||
ctx.user_id,
|
||||
{ beta_program: true }
|
||||
)
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('should not produce an error', async function (ctx) {
|
||||
await new Promise(resolve => {
|
||||
ctx.call(err => {
|
||||
@@ -135,6 +160,21 @@ describe('BetaProgramHandler', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('should set beta_program=false user property in customer.io', async function (ctx) {
|
||||
await new Promise(resolve => {
|
||||
ctx.call(err => {
|
||||
expect(err).to.not.exist
|
||||
sinon.assert.calledWith(
|
||||
ctx.Modules.promises.hooks.fire,
|
||||
'setUserProperties',
|
||||
ctx.user_id,
|
||||
{ beta_program: false }
|
||||
)
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('should not produce an error', async function (ctx) {
|
||||
await new Promise(resolve => {
|
||||
ctx.call(err => {
|
||||
|
||||
Reference in New Issue
Block a user