harness: check balance in basic payment test
This commit is contained in:
parent
e0d4f7e4af
commit
5754f00399
@ -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"];
|
||||||
|
Loading…
Reference in New Issue
Block a user