aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-refund-auto.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-24 18:29:54 +0200
committerFlorian Dold <florian@dold.me>2023-08-24 18:30:03 +0200
commit6cc3fb3d0466e89b67be271009a2fc95f3ed41ca (patch)
treefc21999997bcdbed6c66dc2970dfc473a85bfd37 /packages/taler-harness/src/integrationtests/test-refund-auto.ts
parentf5596767e1ad8f6461a6e64d61519783928624d2 (diff)
downloadwallet-core-6cc3fb3d0466e89b67be271009a2fc95f3ed41ca.tar.xz
harness: modernize some tests
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-refund-auto.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-refund-auto.ts30
1 files changed, 17 insertions, 13 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-refund-auto.ts b/packages/taler-harness/src/integrationtests/test-refund-auto.ts
index 4c2a2f94a..607080e68 100644
--- a/packages/taler-harness/src/integrationtests/test-refund-auto.ts
+++ b/packages/taler-harness/src/integrationtests/test-refund-auto.ts
@@ -17,13 +17,13 @@
/**
* Imports.
*/
+import { Duration, durationFromSpec } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
+ createSimpleTestkudosEnvironmentV2,
+ withdrawViaBankV2,
} from "../harness/helpers.js";
-import { Duration, durationFromSpec } from "@gnu-taler/taler-util";
-import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -31,12 +31,17 @@ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
export async function runRefundAutoTest(t: GlobalTestState) {
// Set up test environment
- const { wallet, bank, exchange, merchant } =
- await createSimpleTestkudosEnvironment(t);
+ const { walletClient, bank, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV2(t);
// Withdraw digital cash into the wallet.
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
+ await withdrawViaBankV2(t, {
+ walletClient,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
// Set up order.
const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
@@ -61,13 +66,12 @@ export async function runRefundAutoTest(t: GlobalTestState) {
// Make wallet pay for the order
- const r1 = await wallet.client.call(WalletApiOperation.PreparePayForUri, {
+ const r1 = await walletClient.call(WalletApiOperation.PreparePayForUri, {
talerPayUri: orderStatus.taler_pay_uri,
});
- await wallet.client.call(WalletApiOperation.ConfirmPay, {
- // FIXME: should be validated, don't cast!
- proposalId: r1.proposalId,
+ await walletClient.call(WalletApiOperation.ConfirmPay, {
+ transactionId: r1.transactionId,
});
// Check if payment was successful.
@@ -88,9 +92,9 @@ export async function runRefundAutoTest(t: GlobalTestState) {
console.log(ref);
// The wallet should now automatically pick up the refund.
- await wallet.runUntilDone();
+ await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
- const transactions = await wallet.client.call(
+ const transactions = await walletClient.call(
WalletApiOperation.GetTransactions,
{},
);