Merge pull request #18225 from overleaf/em-typescript-eslint

Add typescript-eslint rule: no-floating-promises

GitOrigin-RevId: 8c3decdff537c885f5bfeb5250b7805480bc6602
This commit is contained in:
Eric Mc Sween
2024-05-27 10:22:20 +00:00
committed by Copybot
parent 814b085b44
commit 876ee4d967
48 changed files with 1156 additions and 798 deletions
@@ -31,8 +31,8 @@ describe('RecurlyEventHandler', function () {
sendTrialOnboardingEmail: sinon.stub(),
}),
'../Analytics/AnalyticsManager': (this.AnalyticsManager = {
recordEventForUser: sinon.stub(),
setUserPropertyForUser: sinon.stub(),
recordEventForUserInBackground: sinon.stub(),
setUserPropertyForUserInBackground: sinon.stub(),
}),
'../SplitTests/SplitTestHandler': (this.SplitTestHandler = {
promises: {
@@ -51,7 +51,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-started',
{
@@ -62,19 +62,19 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-plan-code',
this.planCode
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-state',
'active'
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-is-trial',
true
@@ -104,7 +104,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-started',
{
@@ -115,13 +115,13 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-state',
'active'
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-is-trial',
false
@@ -136,7 +136,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-updated',
{
@@ -147,19 +147,19 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-plan-code',
this.planCode
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-state',
'active'
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-is-trial',
true
@@ -173,7 +173,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-cancelled',
{
@@ -184,13 +184,13 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-state',
'cancelled'
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-is-trial',
true
@@ -204,7 +204,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-expired',
{
@@ -215,19 +215,19 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-plan-code',
this.planCode
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-state',
'expired'
)
sinon.assert.calledWith(
this.AnalyticsManager.setUserPropertyForUser,
this.AnalyticsManager.setUserPropertyForUserInBackground,
this.userId,
'subscription-is-trial',
true
@@ -240,7 +240,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-renewed',
{
@@ -258,7 +258,7 @@ describe('RecurlyEventHandler', function () {
this.eventData
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-reactivated',
{
@@ -292,7 +292,7 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-invoice-collected',
{
@@ -321,7 +321,7 @@ describe('RecurlyEventHandler', function () {
},
}
)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUser)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUserInBackground)
})
it('with closed_invoice_notification', function () {
@@ -338,7 +338,7 @@ describe('RecurlyEventHandler', function () {
}
)
sinon.assert.calledWith(
this.AnalyticsManager.recordEventForUser,
this.AnalyticsManager.recordEventForUserInBackground,
this.userId,
'subscription-invoice-collected'
)
@@ -357,7 +357,7 @@ describe('RecurlyEventHandler', function () {
},
}
)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUser)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUserInBackground)
})
it('nothing is called with invalid account code', function () {
@@ -367,9 +367,15 @@ describe('RecurlyEventHandler', function () {
'new_subscription_notification',
this.eventData
)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUser)
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
sinon.assert.notCalled(this.AnalyticsManager.setUserPropertyForUser)
sinon.assert.notCalled(this.AnalyticsManager.recordEventForUserInBackground)
sinon.assert.notCalled(
this.AnalyticsManager.setUserPropertyForUserInBackground
)
sinon.assert.notCalled(
this.AnalyticsManager.setUserPropertyForUserInBackground
)
sinon.assert.notCalled(
this.AnalyticsManager.setUserPropertyForUserInBackground
)
})
})