Merge pull request #4050 from overleaf/ta-set-user-property

Send 'created-at' User Property

GitOrigin-RevId: 2a6c8356f0a64ffbc55eac485bb80c38b326f683
This commit is contained in:
Timothée Alby
2021-05-20 02:05:08 +00:00
committed by Copybot
parent 70952906c9
commit 7957c2eae7
5 changed files with 48 additions and 1 deletions
@@ -43,6 +43,7 @@ describe('UserCreator', function () {
}),
'../Analytics/AnalyticsManager': (this.Analytics = {
recordEvent: sinon.stub(),
setUserProperty: sinon.stub(),
}),
'./UserOnboardingEmailManager': (this.UserOnboardingEmailManager = {
scheduleOnboardingEmail: sinon.stub(),
@@ -261,7 +262,7 @@ describe('UserCreator', function () {
assert.equal(user.emails[0].samlProviderId, '1')
})
it('should fire an analytics event on registration', async function () {
it('should fire an analytics event and user property on registration', async function () {
const user = await this.UserCreator.promises.createNewUser({
email: this.email,
})
@@ -271,6 +272,11 @@ describe('UserCreator', function () {
user._id,
'user-registered'
)
sinon.assert.calledWith(
this.Analytics.setUserProperty,
user._id,
'created-at'
)
})
it('should schedule an onboarding email on registration', async function () {