Skip to content

Commit 2689c8f

Browse files
committed
[test] qt: add send screen balance test
1 parent 0ee914b commit 2689c8f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/qt/test/wallettests.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ void TestGUI(interfaces::Node& node)
170170
sendCoinsDialog.setModel(&walletModel);
171171
transactionView.setModel(&walletModel);
172172

173+
{
174+
// Check balance in send dialog
175+
QLabel* balanceLabel = sendCoinsDialog.findChild<QLabel*>("labelBalance");
176+
QString balanceText = balanceLabel->text();
177+
int unit = walletModel.getOptionsModel()->getDisplayUnit();
178+
CAmount balance = walletModel.wallet().getBalance();
179+
QString balanceComparison = BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways);
180+
QCOMPARE(balanceText, balanceComparison);
181+
}
182+
173183
// Send two transactions, and verify they are added to transaction list.
174184
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
175185
QCOMPARE(transactionTableModel->rowCount({}), 105);

0 commit comments

Comments
 (0)