aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-payment-template.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-payment-template.ts
parentf5596767e1ad8f6461a6e64d61519783928624d2 (diff)
downloadwallet-core-6cc3fb3d0466e89b67be271009a2fc95f3ed41ca.tar.xz
harness: modernize some tests
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-template.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-template.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-template.ts b/packages/taler-harness/src/integrationtests/test-payment-template.ts
index 41e43e28a..172791648 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-template.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-template.ts
@@ -17,13 +17,12 @@
/**
* Imports.
*/
-import { ConfirmPayResultType, Duration, PreparePayResultType, TalerProtocolTimestamp } from "@gnu-taler/taler-util";
+import { ConfirmPayResultType, Duration, PreparePayResultType } from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
- makeTestPayment,
+ createSimpleTestkudosEnvironmentV2,
+ withdrawViaBankV2
} from "../harness/helpers.js";
/**
@@ -32,8 +31,8 @@ import {
export async function runPaymentTemplateTest(t: GlobalTestState) {
// Set up test environment
- const { wallet, bank, exchange, merchant } =
- await createSimpleTestkudosEnvironment(t);
+ const { walletClient, bank, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV2(t);
await MerchantPrivateApi.createTemplate(merchant, "default", {
template_id: "template1",
@@ -51,11 +50,11 @@ export async function runPaymentTemplateTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet.
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
+ await withdrawViaBankV2(t, { walletClient, bank, exchange, amount: "TESTKUDOS:20" });
// Request a template payment
- const preparePayResult = await wallet.client.call(
+ const preparePayResult = await walletClient.call(
WalletApiOperation.PreparePayForTemplate,
{
talerPayTemplateUri: `taler+http://pay-template/localhost:${merchant.port}/template1?amount=TESTKUDOS:1`,
@@ -71,7 +70,7 @@ export async function runPaymentTemplateTest(t: GlobalTestState) {
// Pay for it
- const r2 = await wallet.client.call(WalletApiOperation.ConfirmPay, {
+ const r2 = await walletClient.call(WalletApiOperation.ConfirmPay, {
proposalId: preparePayResult.proposalId,
});
@@ -88,8 +87,7 @@ export async function runPaymentTemplateTest(t: GlobalTestState) {
);
t.assertTrue(orderStatus.order_status === "paid");
-
- await wallet.runUntilDone();
+ await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
}
runPaymentTemplateTest.suites = ["wallet"];