summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.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-payment-fault.ts
parent0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff)
downloadwallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.gz
wallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.bz2
wallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.zip
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts')
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts
index 37ae0739c..57ad6a4ff 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-fault.ts
@@ -39,6 +39,7 @@ import {
} from "./faultInjection";
import { CoreApiResponse } from "@gnu-taler/taler-util";
import { defaultCoinConfig } from "./denomStructures";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -124,10 +125,9 @@ export async function runPaymentFaultTest(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();
@@ -137,16 +137,15 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
// Withdraw
- const r2 = await wallet.apiRequest("acceptBankIntegratedWithdrawal", {
+ await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, {
exchangeBaseUrl: faultyExchange.baseUrl,
talerWithdrawUri: wop.taler_withdraw_uri,
});
- t.assertTrue(r2.type === "response");
await wallet.runUntilDone();
// Check balance
- await wallet.getBalances();
+ await wallet.client.call(WalletApiOperation.GetBalances, {});
// Set up order.
@@ -168,12 +167,14 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
let apiResp: CoreApiResponse;
- apiResp = await wallet.apiRequest("preparePay", {
- talerPayUri: orderStatus.taler_pay_uri,
- });
- t.assertTrue(apiResp.type === "response");
+ const prepResp = await wallet.client.call(
+ WalletApiOperation.PreparePayForUri,
+ {
+ talerPayUri: orderStatus.taler_pay_uri,
+ },
+ );
- const proposalId = (apiResp.result as any).proposalId;
+ const proposalId = prepResp.proposalId;
await wallet.runPending();
@@ -196,7 +197,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
// confirmPay won't work, as the exchange is unreachable
- apiResp = await wallet.apiRequest("confirmPay", {
+ await wallet.client.call(WalletApiOperation.ConfirmPay, {
// FIXME: should be validated, don't cast!
proposalId: proposalId,
});