harness: check balance in basic payment test

This commit is contained in:
Florian Dold 2023-06-30 16:44:46 +02:00
parent e0d4f7e4af
commit 5754f00399
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -17,12 +17,14 @@
/** /**
* Imports. * Imports.
*/ */
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState } from "../harness/harness.js"; import { GlobalTestState } from "../harness/harness.js";
import { import {
createSimpleTestkudosEnvironment, createSimpleTestkudosEnvironment,
withdrawViaBank, withdrawViaBank,
makeTestPayment, makeTestPayment,
} from "../harness/helpers.js"; } from "../harness/helpers.js";
import { j2s } from "@gnu-taler/taler-util";
/** /**
* Run test for basic, bank-integrated withdrawal and payment. * Run test for basic, bank-integrated withdrawal and payment.
@ -68,6 +70,12 @@ export async function runPaymentTest(t: GlobalTestState) {
await makeTestPayment(t, { wallet, merchant, order: order3 }); await makeTestPayment(t, { wallet, merchant, order: order3 });
await wallet.runUntilDone(); await wallet.runUntilDone();
const bal = await wallet.client.call(WalletApiOperation.GetBalances, {});
console.log(`balance after 3 payments: ${j2s(bal)}`);
t.assertAmountEquals(bal.balances[0].available, "TESTKUDOS:3.8");
t.assertAmountEquals(bal.balances[0].pendingIncoming, "TESTKUDOS:0");
t.assertAmountEquals(bal.balances[0].pendingOutgoing, "TESTKUDOS:0");
} }
runPaymentTest.suites = ["wallet"]; runPaymentTest.suites = ["wallet"];