diff options
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts | 28 |
1 files changed, 27 insertions, 1 deletions
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"]; |