Merge pull request #6559 from overleaf/tm-teardown-onboarding-email-split-test
Implement 'send-email' variant for trial onboarding email for all users GitOrigin-RevId: f53b86d875a1a4e146dc57603b7a83ac098f9cdf
This commit is contained in:
@@ -29,11 +29,6 @@ describe('RecurlyEventHandler', function () {
|
||||
'./SubscriptionEmailHandler': (this.SubscriptionEmailHandler = {
|
||||
sendTrialOnboardingEmail: sinon.stub(),
|
||||
}),
|
||||
'../SplitTests/SplitTestHandler': (this.SplitTestHandler = {
|
||||
promises: {
|
||||
getAssignmentForUser: sinon.stub().resolves({ variant: 'default' }),
|
||||
},
|
||||
}),
|
||||
'../Analytics/AnalyticsManager': (this.AnalyticsManager = {
|
||||
recordEventForUser: sinon.stub(),
|
||||
setUserPropertyForUser: sinon.stub(),
|
||||
@@ -75,28 +70,14 @@ describe('RecurlyEventHandler', function () {
|
||||
'subscription-is-trial',
|
||||
true
|
||||
)
|
||||
sinon.assert.calledWith(
|
||||
this.SplitTestHandler.promises.getAssignmentForUser,
|
||||
this.userId,
|
||||
'trial-onboarding-email'
|
||||
)
|
||||
})
|
||||
|
||||
it('sends free trial onboarding email if user in ab group', async function () {
|
||||
this.SplitTestHandler.promises.getAssignmentForUser = sinon
|
||||
.stub()
|
||||
.resolves({ variant: 'send-email' })
|
||||
|
||||
it('sends free trial onboarding email if user starting a trial', async function () {
|
||||
await this.RecurlyEventHandler.sendRecurlyAnalyticsEvent(
|
||||
'new_subscription_notification',
|
||||
this.eventData
|
||||
)
|
||||
|
||||
sinon.assert.calledWith(
|
||||
this.SplitTestHandler.promises.getAssignmentForUser,
|
||||
this.userId,
|
||||
'trial-onboarding-email'
|
||||
)
|
||||
sinon.assert.called(this.SubscriptionEmailHandler.sendTrialOnboardingEmail)
|
||||
})
|
||||
|
||||
@@ -356,6 +337,5 @@ describe('RecurlyEventHandler', function () {
|
||||
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
|
||||
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
|
||||
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
|
||||
sinon.assert.notCalled(this.SplitTestHandler.promises.getAssignmentForUser)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user