summaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-payment-claim.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-01-08 11:40:50 +0100
committerFlorian Dold <florian@dold.me>2024-01-08 11:40:50 +0100
commit06fb3a5c910b5be37fbd386a5e42588903bece9b (patch)
treede3ed373c38aad992994d07443cbb03063440a74 /packages/taler-harness/src/integrationtests/test-payment-claim.ts
parent1b9db448dc3dd4893c484c63cf459d7d9250e693 (diff)
downloadwallet-core-06fb3a5c910b5be37fbd386a5e42588903bece9b.tar.gz
wallet-core-06fb3a5c910b5be37fbd386a5e42588903bece9b.tar.bz2
wallet-core-06fb3a5c910b5be37fbd386a5e42588903bece9b.zip
harness: fix payment-claim test
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-claim.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-claim.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-claim.ts b/packages/taler-harness/src/integrationtests/test-payment-claim.ts
index b5ed89ec3..3595a1750 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-claim.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-claim.ts
@@ -23,14 +23,15 @@ import {
TalerErrorCode,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, WalletCli } from "../harness/harness.js";
+import { GlobalTestState } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV2,
+ createWalletDaemonWithClient,
withdrawViaBankV2,
} from "../harness/helpers.js";
/**
- * Run test for basic, bank-integrated withdrawal.
+ * Run test where a wallet tries to claim an already claimed order.
*/
export async function runPaymentClaimTest(t: GlobalTestState) {
// Set up test environment
@@ -40,7 +41,7 @@ export async function runPaymentClaimTest(t: GlobalTestState) {
const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl());
- const walletTwo = new WalletCli(t, "two");
+ const w2 = await createWalletDaemonWithClient(t, { name: "w2" });
// Withdraw digital cash into the wallet.
@@ -84,14 +85,16 @@ export async function runPaymentClaimTest(t: GlobalTestState) {
preparePayResult.status === PreparePayResultType.PaymentPossible,
);
- t.assertThrowsTalerErrorAsync(async () => {
- await walletTwo.client.call(WalletApiOperation.PreparePayForUri, {
+ const errOne = t.assertThrowsTalerErrorAsync(async () => {
+ await w2.walletClient.call(WalletApiOperation.PreparePayForUri, {
talerPayUri,
});
});
+ console.log(errOne);
+
await walletClient.call(WalletApiOperation.ConfirmPay, {
- proposalId: preparePayResult.proposalId,
+ transactionId: preparePayResult.transactionId,
});
// Check if payment was successful.
@@ -102,10 +105,10 @@ export async function runPaymentClaimTest(t: GlobalTestState) {
t.assertTrue(orderStatus.order_status === "paid");
- walletTwo.deleteDatabase();
+ await w2.walletClient.call(WalletApiOperation.ClearDb, {});
const err = await t.assertThrowsTalerErrorAsync(async () => {
- await walletTwo.client.call(WalletApiOperation.PreparePayForUri, {
+ await w2.walletClient.call(WalletApiOperation.PreparePayForUri, {
talerPayUri,
});
});