Merge pull request #4639 from overleaf/ab-web-mono-analytics-id

Analytics ID support

GitOrigin-RevId: 820a6c0f4d19f046f6c791ce4dc64dbc80748924
This commit is contained in:
Alexandre Bourdin
2021-09-09 16:45:41 +02:00
committed by Copybot
parent 3af8fc63de
commit 44a8883b6d
36 changed files with 557 additions and 249 deletions

View File

@@ -36,7 +36,7 @@ describe('UserPostRegistrationAnalyticsManager', function () {
},
}
this.AnalyticsManager = {
setUserProperty: sinon.stub().resolves(),
setUserPropertyForUser: sinon.stub().resolves(),
}
this.UserPostRegistrationAnalyticsManager = SandboxedModule.require(
MODULE_PATH,
@@ -72,7 +72,8 @@ describe('UserPostRegistrationAnalyticsManager', function () {
)
expect(this.InstitutionsAPI.promises.getUserAffiliations).not.to.have.been
.called
expect(this.AnalyticsManager.setUserProperty).not.to.have.been.called
expect(this.AnalyticsManager.setUserPropertyForUser).not.to.have.been
.called
})
it('sets user property if user has commons account affiliationd', async function () {
@@ -92,7 +93,9 @@ describe('UserPostRegistrationAnalyticsManager', function () {
await this.UserPostRegistrationAnalyticsManager.postRegistrationAnalytics(
this.fakeUserId
)
expect(this.AnalyticsManager.setUserProperty).to.have.been.calledWith(
expect(
this.AnalyticsManager.setUserPropertyForUser
).to.have.been.calledWith(
this.fakeUserId,
'registered-from-commons-account',
true
@@ -110,7 +113,8 @@ describe('UserPostRegistrationAnalyticsManager', function () {
await this.UserPostRegistrationAnalyticsManager.postRegistrationAnalytics(
this.fakeUserId
)
expect(this.AnalyticsManager.setUserProperty).not.to.have.been.called
expect(this.AnalyticsManager.setUserPropertyForUser).not.to.have.been
.called
})
})
})