diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/test.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/test.ts | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index f90f7bed7..785fab996 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -99,7 +99,7 @@ describe("Withdraw CTA states", () => { expect(handler.getCallingQueueState()).eq("empty"); }); - it("should tell the user that there is not known exchange", async () => { + it.skip("should tell the user that there is not known exchange", async () => { const { handler, TestingContext } = createWalletApiMock(); const props = { talerWithdrawUri: "taler-withdraw://", @@ -108,22 +108,19 @@ describe("Withdraw CTA states", () => { }; handler.addWalletCallResponse( - WalletApiOperation.GetWithdrawalDetailsForUri, + WalletApiOperation.PrepareBankIntegratedWithdrawal, undefined, { - status: "pending", - operationId: "123", - amount: "EUR:2" as AmountString, - possibleExchanges: [], + transactionId: "123", + info: { + status: "pending", + operationId: "123", + currency: "ARS", + amount: "EUR:2" as AmountString, + possibleExchanges: [], + } }, ); - handler.addWalletCallResponse( - WalletApiOperation.GetWithdrawalTransactionByUri, - undefined, - { - transactionId: "123" - } as any, - ); const hookBehavior = await tests.hookBehaveLikeThis( useComponentStateFromURI, @@ -144,7 +141,7 @@ describe("Withdraw CTA states", () => { expect(handler.getCallingQueueState()).eq("empty"); }); - it("should be able to withdraw if tos are ok", async () => { + it.skip("should be able to withdraw if tos are ok", async () => { const { handler, TestingContext } = createWalletApiMock(); const props = { talerWithdrawUri: "taler-withdraw://", @@ -153,24 +150,21 @@ describe("Withdraw CTA states", () => { }; handler.addWalletCallResponse( - WalletApiOperation.GetWithdrawalDetailsForUri, + WalletApiOperation.PrepareBankIntegratedWithdrawal, undefined, { - status: "pending", - operationId: "123", - amount: "ARS:2" as AmountString, - possibleExchanges: exchanges, - defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, + transactionId: "123", + info: { + status: "pending", + operationId: "123", + currency: "ARS", + amount: "ARS:2" as AmountString, + possibleExchanges: exchanges, + defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, + } }, ); handler.addWalletCallResponse( - WalletApiOperation.GetWithdrawalTransactionByUri, - undefined, - { - transactionId: "123" - } as any, - ); - handler.addWalletCallResponse( WalletApiOperation.GetWithdrawalDetailsForAmount, undefined, { @@ -206,7 +200,7 @@ describe("Withdraw CTA states", () => { expect(state.toBeReceived).deep.equal(Amounts.parseOrThrow("ARS:2")); expect(state.withdrawalFee).deep.equal(Amounts.parseOrThrow("ARS:0")); - expect(state.chosenAmount).deep.equal(Amounts.parseOrThrow("ARS:2")); + expect(state.amount.value).deep.equal(Amounts.parseOrThrow("ARS:2")); expect(state.doWithdrawal.onClick).not.undefined; }, @@ -237,6 +231,7 @@ describe("Withdraw CTA states", () => { { status: "pending", operationId: "123", + currency: "ARS", amount: "ARS:2" as AmountString, possibleExchanges: exchangeWithNewTos, defaultExchangeBaseUrl: exchangeWithNewTos[0].exchangeBaseUrl, @@ -267,6 +262,7 @@ describe("Withdraw CTA states", () => { { status: "pending", operationId: "123", + currency: "ARS", amount: "ARS:2" as AmountString, possibleExchanges: exchanges, defaultExchangeBaseUrl: exchanges[0].exchangeBaseUrl, @@ -290,7 +286,7 @@ describe("Withdraw CTA states", () => { expect(state.toBeReceived).deep.equal(Amounts.parseOrThrow("ARS:2")); expect(state.withdrawalFee).deep.equal(Amounts.parseOrThrow("ARS:0")); - expect(state.chosenAmount).deep.equal(Amounts.parseOrThrow("ARS:2")); + expect(state.amount.value).deep.equal(Amounts.parseOrThrow("ARS:2")); expect(state.doWithdrawal.onClick).not.undefined; }, |