taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 06fb3a5c910b5be37fbd386a5e42588903bece9b
parent 1b9db448dc3dd4893c484c63cf459d7d9250e693
Author: Florian Dold <florian@dold.me>
Date:   Mon,  8 Jan 2024 11:40:50 +0100

harness: fix payment-claim test

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-payment-claim.ts | 19+++++++++++--------
1 file 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 @@ -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, }); });