Skip to content

Commit 705fbd6

Browse files
committed
revert changes
1 parent 7bd4c99 commit 705fbd6

File tree

1 file changed

+1
-64
lines changed

1 file changed

+1
-64
lines changed

packages/realm-server/tests/billing-test.ts

+1-64
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ module('billing', function (hooks) {
132132
await handlePaymentSucceeded(
133133
dbAdapter,
134134
stripeInvoicePaymentSucceededEvent,
135-
async function (stripeUserId: string) {
136-
assert.strictEqual(
137-
stripeUserId,
138-
stripeInvoicePaymentSucceededEvent.data.object.customer,
139-
);
140-
},
141135
);
142136

143137
// Assert that the stripe event was inserted and processed
@@ -197,16 +191,7 @@ module('billing', function (hooks) {
197191

198192
// Error if stripe event is attempted to be processed again when it's already been processed
199193
await assert.rejects(
200-
handlePaymentSucceeded(
201-
dbAdapter,
202-
stripeInvoicePaymentSucceededEvent,
203-
async function (stripeUserId: string) {
204-
assert.strictEqual(
205-
stripeUserId,
206-
stripeInvoicePaymentSucceededEvent.data.object.customer,
207-
);
208-
},
209-
),
194+
handlePaymentSucceeded(dbAdapter, stripeInvoicePaymentSucceededEvent),
210195
'error: duplicate key value violates unique constraint "stripe_events_pkey"',
211196
);
212197
});
@@ -297,12 +282,6 @@ module('billing', function (hooks) {
297282
await handlePaymentSucceeded(
298283
dbAdapter,
299284
stripeInvoicePaymentSucceededEvent,
300-
async function (stripeUserId: string) {
301-
assert.strictEqual(
302-
stripeUserId,
303-
stripeInvoicePaymentSucceededEvent.data.object.customer,
304-
);
305-
},
306285
);
307286

308287
// Assert that new subscription was created
@@ -399,12 +378,6 @@ module('billing', function (hooks) {
399378
await handlePaymentSucceeded(
400379
dbAdapter,
401380
stripeInvoicePaymentSucceededEvent,
402-
async function (stripeUserId: string) {
403-
assert.strictEqual(
404-
stripeUserId,
405-
stripeInvoicePaymentSucceededEvent.data.object.customer,
406-
);
407-
},
408381
);
409382

410383
// Assert there are now three subscriptions and last one is active
@@ -488,12 +461,6 @@ module('billing', function (hooks) {
488461
await handlePaymentSucceeded(
489462
dbAdapter,
490463
stripeInvoicePaymentSucceededEvent,
491-
async function (stripeUserId: string) {
492-
assert.strictEqual(
493-
stripeUserId,
494-
stripeInvoicePaymentSucceededEvent.data.object.customer,
495-
);
496-
},
497464
);
498465

499466
// Assert there are now four subscriptions and last one is active
@@ -562,12 +529,6 @@ module('billing', function (hooks) {
562529
await handlePaymentSucceeded(
563530
dbAdapter,
564531
stripeInvoicePaymentSucceededEvent,
565-
async function (stripeUserId: string) {
566-
assert.strictEqual(
567-
stripeUserId,
568-
stripeInvoicePaymentSucceededEvent.data.object.customer,
569-
);
570-
},
571532
);
572533

573534
// Assert there are now 5 subscriptions and last one is active
@@ -681,12 +642,6 @@ module('billing', function (hooks) {
681642
await handlePaymentSucceeded(
682643
dbAdapter,
683644
stripeInvoicePaymentSucceededEvent,
684-
async function (stripeUserId: string) {
685-
assert.strictEqual(
686-
stripeUserId,
687-
stripeInvoicePaymentSucceededEvent.data.object.customer,
688-
);
689-
},
690645
);
691646

692647
// Assert that there are now two subscription cycles
@@ -754,12 +709,6 @@ module('billing', function (hooks) {
754709
await handleSubscriptionDeleted(
755710
dbAdapter,
756711
stripeSubscriptionDeletedEvent,
757-
async function (stripeUserId: string) {
758-
assert.strictEqual(
759-
stripeUserId,
760-
stripeSubscriptionDeletedEvent.data.object.customer,
761-
);
762-
},
763712
);
764713

765714
let subscriptions = await fetchSubscriptionsByUserId(dbAdapter, user.id);
@@ -800,12 +749,6 @@ module('billing', function (hooks) {
800749
await handleCheckoutSessionCompleted(
801750
dbAdapter,
802751
stripeCheckoutSessionCompletedEvent,
803-
async function (stripeUserId: string) {
804-
assert.strictEqual(
805-
stripeUserId,
806-
stripeCheckoutSessionCompletedEvent.data.object.customer,
807-
);
808-
},
809752
);
810753

811754
let stripeEvents = await fetchStripeEvents(dbAdapter);
@@ -844,12 +787,6 @@ module('billing', function (hooks) {
844787
await handleCheckoutSessionCompleted(
845788
dbAdapter,
846789
stripeCheckoutSessionCompletedEvent,
847-
async function (stripeUserId: string) {
848-
assert.strictEqual(
849-
stripeUserId,
850-
stripeCheckoutSessionCompletedEvent.data.object.customer,
851-
);
852-
},
853790
);
854791

855792
let availableExtraCredits = await sumUpCreditsLedger(dbAdapter, {

0 commit comments

Comments
 (0)