diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts index 1489e2bb9..a06b1ae75 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts @@ -23,6 +23,7 @@ import { Amounts, DepositGroupFees, parsePaytoUri, + PrepareDepositResponse, ScopeType, stringifyPaytoUri, } from "@gnu-taler/taler-util"; @@ -36,16 +37,24 @@ import { useComponentState } from "./state.js"; const currency = "EUR"; const amount = `${currency}:0`; -const withoutFee = (): DepositGroupFees => ({ - coin: Amounts.stringify(`${currency}:0`), - wire: Amounts.stringify(`${currency}:0`), - refresh: Amounts.stringify(`${currency}:0`), +const withoutFee = (): PrepareDepositResponse => ({ + effectiveDepositAmount: `${currency}:5`, + totalDepositCost: `${currency}:5`, + fees: { + coin: Amounts.stringify(`${currency}:0`), + wire: Amounts.stringify(`${currency}:0`), + refresh: Amounts.stringify(`${currency}:0`), + }, }); -const withSomeFee = (): DepositGroupFees => ({ - coin: Amounts.stringify(`${currency}:1`), - wire: Amounts.stringify(`${currency}:1`), - refresh: Amounts.stringify(`${currency}:1`), +const withSomeFee = (): PrepareDepositResponse => ({ + effectiveDepositAmount: `${currency}:5`, + totalDepositCost: `${currency}:5`, + fees: { + coin: Amounts.stringify(`${currency}:1`), + wire: Amounts.stringify(`${currency}:1`), + refresh: Amounts.stringify(`${currency}:1`), + }, }); describe("DepositPage states", () => { @@ -182,7 +191,7 @@ describe("DepositPage states", () => { }, ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withoutFee(), ); @@ -241,13 +250,13 @@ describe("DepositPage states", () => { }, ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withoutFee(), ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withoutFee(), ); @@ -330,17 +339,17 @@ describe("DepositPage states", () => { }, ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withoutFee(), ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withSomeFee(), ); handler.addWalletCallResponse( - WalletApiOperation.GetFeeForDeposit, + WalletApiOperation.PrepareDeposit, undefined, withSomeFee(), ); |