@@ -225,6 +225,7 @@ void TestGUI(interfaces::Node& node)
225
225
int initialRowCount = requestTableModel->rowCount ({});
226
226
QPushButton* requestPaymentButton = receiveCoinsDialog.findChild <QPushButton*>(" receiveButton" );
227
227
requestPaymentButton->click ();
228
+ QString address;
228
229
for (QWidget* widget : QApplication::topLevelWidgets ()) {
229
230
if (widget->inherits (" ReceiveRequestDialog" )) {
230
231
ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);
@@ -233,6 +234,9 @@ void TestGUI(interfaces::Node& node)
233
234
QString uri = receiveRequestDialog->QObject ::findChild<QLabel*>(" uri_content" )->text ();
234
235
QCOMPARE (uri.count (" bitcoin:" ), 2 );
235
236
QCOMPARE (receiveRequestDialog->QObject ::findChild<QLabel*>(" address_tag" )->text (), QString (" Address:" ));
237
+ QVERIFY (address.isEmpty ());
238
+ address = receiveRequestDialog->QObject ::findChild<QLabel*>(" address_content" )->text ();
239
+ QVERIFY (!address.isEmpty ());
236
240
237
241
QCOMPARE (uri.count (" amount=0.00000001" ), 2 );
238
242
QCOMPARE (receiveRequestDialog->QObject ::findChild<QLabel*>(" amount_tag" )->text (), QString (" Amount:" ));
@@ -259,12 +263,30 @@ void TestGUI(interfaces::Node& node)
259
263
int currentRowCount = requestTableModel->rowCount ({});
260
264
QCOMPARE (currentRowCount, initialRowCount+1 );
261
265
266
+ // Check addition to wallet
267
+ std::vector<std::string> requests = walletModel.wallet ().getDestValues (" rr" );
268
+ QCOMPARE (requests.size (), size_t {1 });
269
+ RecentRequestEntry entry;
270
+ CDataStream{MakeUCharSpan (requests[0 ]), SER_DISK, CLIENT_VERSION} >> entry;
271
+ QCOMPARE (entry.nVersion , int {1 });
272
+ QCOMPARE (entry.id , int64_t {1 });
273
+ QVERIFY (entry.date .isValid ());
274
+ QCOMPARE (entry.recipient .address , address);
275
+ QCOMPARE (entry.recipient .label , QString{" TEST_LABEL_1" });
276
+ QCOMPARE (entry.recipient .amount , CAmount{1 });
277
+ QCOMPARE (entry.recipient .message , QString{" TEST_MESSAGE_1" });
278
+ QCOMPARE (entry.recipient .sPaymentRequest , std::string{});
279
+ QCOMPARE (entry.recipient .authenticatedMerchant , QString{});
280
+
262
281
// Check Remove button
263
282
QTableView* table = receiveCoinsDialog.findChild <QTableView*>(" recentRequestsView" );
264
283
table->selectRow (currentRowCount-1 );
265
284
QPushButton* removeRequestButton = receiveCoinsDialog.findChild <QPushButton*>(" removeRequestButton" );
266
285
removeRequestButton->click ();
267
286
QCOMPARE (requestTableModel->rowCount ({}), currentRowCount-1 );
287
+
288
+ // Check removal from wallet
289
+ QCOMPARE (walletModel.wallet ().getDestValues (" rr" ).size (), size_t {0 });
268
290
}
269
291
270
292
} // namespace
0 commit comments