commit d223f963021eb1562d6d3be350d79c27d0499ec0
parent 1ecd9e8781610b5de5eea474ce399405f25edb24
Author: Florian Dold <florian@dold.me>
Date: Tue, 20 Feb 2024 00:05:32 +0100
harness: test for pendingIncoming
Diffstat:
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git 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"];