From e14310825437c5de93c07c570639d2a09fc4826b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 16 Sep 2022 16:04:41 -0300 Subject: pretty --- .../src/cta/Payment/test.ts | 204 +++++++++++---------- 1 file changed, 110 insertions(+), 94 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/Payment/test.ts') diff --git a/packages/taler-wallet-webextension/src/cta/Payment/test.ts b/packages/taler-wallet-webextension/src/cta/Payment/test.ts index 91d2d825d..f4ce5afb3 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Payment/test.ts @@ -75,7 +75,9 @@ describe("Payment CTA states", () => { talerPayUri: undefined, cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, @@ -111,19 +113,21 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:10", - status: PreparePayResultType.InsufficientBalance, - } as Partial), + ({ + amountRaw: "USD:10", + status: PreparePayResultType.InsufficientBalance, + } as Partial), getBalance: async () => - ({ - balances: [], - } as Partial), + ({ + balances: [], + } as Partial), } as Partial as any, ), ); @@ -154,23 +158,25 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:10", - status: PreparePayResultType.InsufficientBalance, - } as Partial), + ({ + amountRaw: "USD:10", + status: PreparePayResultType.InsufficientBalance, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: "USD:5", - }, - ], - } as Partial), + ({ + balances: [ + { + available: "USD:5", + }, + ], + } as Partial), } as Partial as any, ), ); @@ -201,24 +207,26 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:10", - amountEffective: "USD:10", - status: PreparePayResultType.PaymentPossible, - } as Partial), + ({ + amountRaw: "USD:10", + amountEffective: "USD:10", + status: PreparePayResultType.PaymentPossible, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: "USD:15", - }, - ], - } as Partial), + ({ + balances: [ + { + available: "USD:15", + }, + ], + } as Partial), } as Partial as any, ), ); @@ -251,24 +259,26 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:9", - amountEffective: "USD:10", - status: PreparePayResultType.PaymentPossible, - } as Partial), + ({ + amountRaw: "USD:9", + amountEffective: "USD:10", + status: PreparePayResultType.PaymentPossible, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: "USD:15", - }, - ], - } as Partial), + ({ + balances: [ + { + available: "USD:15", + }, + ], + } as Partial), } as Partial as any, ), ); @@ -301,29 +311,31 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:9", - amountEffective: "USD:10", - status: PreparePayResultType.PaymentPossible, - } as Partial), + ({ + amountRaw: "USD:9", + amountEffective: "USD:10", + status: PreparePayResultType.PaymentPossible, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: "USD:15", - }, - ], - } as Partial), + ({ + balances: [ + { + available: "USD:15", + }, + ], + } as Partial), confirmPay: async () => - ({ - type: ConfirmPayResultType.Done, - contractTerms: {}, - } as Partial), + ({ + type: ConfirmPayResultType.Done, + contractTerms: {}, + } as Partial), } as Partial as any, ), ); @@ -370,29 +382,31 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: nullFunction, preparePay: async () => - ({ - amountRaw: "USD:9", - amountEffective: "USD:10", - status: PreparePayResultType.PaymentPossible, - } as Partial), + ({ + amountRaw: "USD:9", + amountEffective: "USD:10", + status: PreparePayResultType.PaymentPossible, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: "USD:15", - }, - ], - } as Partial), + ({ + balances: [ + { + available: "USD:15", + }, + ], + } as Partial), confirmPay: async () => - ({ - type: ConfirmPayResultType.Pending, - lastError: { code: 1 }, - } as Partial), + ({ + type: ConfirmPayResultType.Pending, + lastError: { code: 1 }, + } as Partial), } as Partial as any, ), ); @@ -454,24 +468,26 @@ describe("Payment CTA states", () => { talerPayUri: "taller://pay", cancel: nullFunction, goToWalletManualWithdraw: nullFunction, - onSuccess: async () => { null; }, + onSuccess: async () => { + null; + }, }, { onUpdateNotification: subscriptions.saveSubscription, preparePay: async () => - ({ - amountRaw: "USD:9", - amountEffective: "USD:10", - status: PreparePayResultType.PaymentPossible, - } as Partial), + ({ + amountRaw: "USD:9", + amountEffective: "USD:10", + status: PreparePayResultType.PaymentPossible, + } as Partial), getBalance: async () => - ({ - balances: [ - { - available: Amounts.stringify(availableBalance), - }, - ], - } as Partial), + ({ + balances: [ + { + available: Amounts.stringify(availableBalance), + }, + ], + } as Partial), } as Partial as any, ), ); -- cgit v1.2.3