diff options
author | Florian Dold <florian@dold.me> | 2022-10-14 18:40:04 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-14 18:48:03 +0200 |
commit | 6acddd6d70abc568e4b3740f56662691278aa645 (patch) | |
tree | 2733a5669090e54a864ad7c1052ef21fffc5aa06 /packages/taler-wallet-webextension/src/cta/Withdraw/test.ts | |
parent | da9ec5eb16298d8ca5690800eca1c15f5a6cfaa5 (diff) | |
download | wallet-core-6acddd6d70abc568e4b3740f56662691278aa645.tar.xz |
wallet-core: get rid of duplicated withdrawal info API
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/test.ts | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index f3598b557..d86771208 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -22,14 +22,11 @@ import { Amounts, ExchangeFullDetails, - ExchangeListItem, GetExchangeTosResult, } from "@gnu-taler/taler-util"; -import { ExchangeWithdrawDetails } from "@gnu-taler/taler-wallet-core"; import { expect } from "chai"; import { mountHook } from "../../test-utils.js"; import { useComponentStateFromURI } from "./state.js"; -import * as wxApi from "../../wxApi.js"; const exchanges: ExchangeFullDetails[] = [ { @@ -162,20 +159,11 @@ describe("Withdraw CTA states", () => { }, { listExchanges: async () => ({ exchanges }), - getWithdrawalDetailsForUri: async ({ - talerWithdrawUri, - }: any): Promise<ExchangeWithdrawDetails> => - ({ - amount: "ARS:2", - possibleExchanges: exchanges, - defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, - } as Partial<ExchangeWithdrawDetails> as ExchangeWithdrawDetails), - getExchangeWithdrawalInfo: - async (): Promise<ExchangeWithdrawDetails> => - ({ - withdrawalAmountRaw: "ARS:2", - withdrawalAmountEffective: "ARS:2", - } as any), + getWithdrawalDetailsForUri: async ({ talerWithdrawUri }: any) => ({ + amount: "ARS:2", + possibleExchanges: exchanges, + defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, + }), getExchangeTos: async (): Promise<GetExchangeTosResult> => ({ contentType: "text", content: "just accept", @@ -255,19 +243,12 @@ describe("Withdraw CTA states", () => { }, }, { - listExchanges: async () => listExchangesResponse, - getWithdrawalDetailsForUri: async ({ talerWithdrawUri }: any) => - ({ - amount: "ARS:2", - possibleExchanges: exchanges, - defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, - } as Partial<ExchangeWithdrawDetails> as ExchangeWithdrawDetails), - getExchangeWithdrawalInfo: - async (): Promise<ExchangeWithdrawDetails> => - ({ - withdrawalAmountRaw: "ARS:2", - withdrawalAmountEffective: "ARS:2", - } as any), + listExchanges: async () => ({ exchanges }), + getWithdrawalDetailsForUri: async ({ talerWithdrawUri }: any) => ({ + amount: "ARS:2", + possibleExchanges: exchanges, + defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, + }), getExchangeTos: async (): Promise<GetExchangeTosResult> => ({ contentType: "text", content: "just accept", |