From d223f963021eb1562d6d3be350d79c27d0499ec0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 20 Feb 2024 00:05:32 +0100 Subject: harness: test for pendingIncoming --- .../test-wallet-balance-notifications.ts | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'packages/taler-harness/src') diff --git a/packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts b/packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts index 66093410f..290ef7e2d 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts @@ -32,7 +32,7 @@ import { createSimpleTestkudosEnvironmentV2 } from "../harness/helpers.js"; export async function runWalletBalanceNotificationsTest(t: GlobalTestState) { // Set up test environment - const { walletClient, bank, exchange, merchant } = + const { walletClient, bank, exchange, merchant, walletService } = await createSimpleTestkudosEnvironmentV2(t); const amount = "TESTKUDOS:20"; @@ -80,6 +80,32 @@ export async function runWalletBalanceNotificationsTest(t: GlobalTestState) { }); await withdrawalFinishedCond; + + // Second withdrawal! + { + const wop2 = await bankClient.createWithdrawalOperation( + user.username, + "TESTKUDOS:5", + ); + + await walletClient.call(WalletApiOperation.GetWithdrawalDetailsForUri, { + talerWithdrawUri: wop2.taler_withdraw_uri, + }); + + const acceptRes = await walletClient.call( + WalletApiOperation.AcceptBankIntegratedWithdrawal, + { + exchangeBaseUrl: exchange.baseUrl, + talerWithdrawUri: wop2.taler_withdraw_uri, + }, + ); + + const bal = await walletClient.call(WalletApiOperation.GetBalances, {}); + t.assertAmountEquals(bal.balances[0].available, "TESTKUDOS:19.53"); + t.assertAmountEquals(bal.balances[0].pendingIncoming, "TESTKUDOS:4.85"); + + await walletService.stop(); + } } runWalletBalanceNotificationsTest.suites = ["wallet"]; -- cgit v1.2.3