mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
[test] qt: add send screen balance test
This commit is contained in:
parent
0ee914ba9e
commit
2689c8fd71
1 changed files with 10 additions and 0 deletions
|
@ -170,6 +170,16 @@ void TestGUI(interfaces::Node& node)
|
||||||
sendCoinsDialog.setModel(&walletModel);
|
sendCoinsDialog.setModel(&walletModel);
|
||||||
transactionView.setModel(&walletModel);
|
transactionView.setModel(&walletModel);
|
||||||
|
|
||||||
|
{
|
||||||
|
// Check balance in send dialog
|
||||||
|
QLabel* balanceLabel = sendCoinsDialog.findChild<QLabel*>("labelBalance");
|
||||||
|
QString balanceText = balanceLabel->text();
|
||||||
|
int unit = walletModel.getOptionsModel()->getDisplayUnit();
|
||||||
|
CAmount balance = walletModel.wallet().getBalance();
|
||||||
|
QString balanceComparison = BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways);
|
||||||
|
QCOMPARE(balanceText, balanceComparison);
|
||||||
|
}
|
||||||
|
|
||||||
// Send two transactions, and verify they are added to transaction list.
|
// Send two transactions, and verify they are added to transaction list.
|
||||||
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
|
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
|
||||||
QCOMPARE(transactionTableModel->rowCount({}), 105);
|
QCOMPARE(transactionTableModel->rowCount({}), 105);
|
||||||
|
|
Loading…
Add table
Reference in a new issue