aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-17 13:34:59 +0200
committerFlorian Dold <florian@dold.me>2021-06-17 13:35:08 +0200
commit5df7ddba97aa4482c781bfe8e87f60c3bc195ae4 (patch)
tree0956d310a83f0fafbb7d5a93001566f9035269a0 /packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts
parent0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff)
downloadwallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.xz
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts')
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts22
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts
index bfffa23b3..896b1e877 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-withdrawal-abort-bank.ts
@@ -18,6 +18,7 @@
* Imports.
*/
import { TalerErrorCode } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState, BankApi, BankAccessApi } from "./harness";
import { createSimpleTestkudosEnvironment } from "./helpers";
@@ -40,10 +41,9 @@ export async function runWithdrawalAbortBankTest(t: GlobalTestState) {
// Hand it to the wallet
- const r1 = await wallet.apiRequest("getWithdrawalDetailsForUri", {
+ await wallet.client.call(WalletApiOperation.GetWithdrawalDetailsForUri, {
talerWithdrawUri: wop.taler_withdraw_uri,
});
- t.assertTrue(r1.type === "response");
await wallet.runPending();
@@ -53,14 +53,18 @@ export async function runWithdrawalAbortBankTest(t: GlobalTestState) {
// Withdraw
- const r2 = await wallet.apiRequest("acceptBankIntegratedWithdrawal", {
- exchangeBaseUrl: exchange.baseUrl,
- talerWithdrawUri: wop.taler_withdraw_uri,
+ const e = await t.assertThrowsOperationErrorAsync(async () => {
+ await wallet.client.call(
+ WalletApiOperation.AcceptBankIntegratedWithdrawal,
+ {
+ exchangeBaseUrl: exchange.baseUrl,
+ talerWithdrawUri: wop.taler_withdraw_uri,
+ },
+ );
});
- t.assertTrue(r2.type === "error");
- t.assertTrue(
- r2.error.code ===
- TalerErrorCode.WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK,
+ t.assertDeepEqual(
+ e.operationError.code,
+ TalerErrorCode.WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK,
);
await t.shutdown();