summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-20 00:05:32 +0100
committerFlorian Dold <florian@dold.me>2024-02-20 00:05:32 +0100
commitd223f963021eb1562d6d3be350d79c27d0499ec0 (patch)
treebe3a696bc0653cf7deeffc06314aa1e8ee5ff30f
parent1ecd9e8781610b5de5eea474ce399405f25edb24 (diff)
downloadwallet-core-d223f963021eb1562d6d3be350d79c27d0499ec0.tar.gz
wallet-core-d223f963021eb1562d6d3be350d79c27d0499ec0.tar.bz2
wallet-core-d223f963021eb1562d6d3be350d79c27d0499ec0.zip
harness: test for pendingIncoming
-rw-r--r--packages/taler-harness/src/integrationtests/test-wallet-balance-notifications.ts28
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"];