@@ -187,6 +187,7 @@ void TestGUI(interfaces::Node& node)
187
187
int initialRowCount = requestTableModel->rowCount ({});
188
188
QPushButton* requestPaymentButton = receiveCoinsDialog.findChild <QPushButton*>(" receiveButton" );
189
189
requestPaymentButton->click ();
190
+ QString address;
190
191
for (QWidget* widget : QApplication::topLevelWidgets ()) {
191
192
if (widget->inherits (" ReceiveRequestDialog" )) {
192
193
ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);
@@ -195,6 +196,9 @@ void TestGUI(interfaces::Node& node)
195
196
QString uri = receiveRequestDialog->QObject ::findChild<QLabel*>(" uri_content" )->text ();
196
197
QCOMPARE (uri.count (" dash:" ), 2 );
197
198
QCOMPARE (receiveRequestDialog->QObject ::findChild<QLabel*>(" address_tag" )->text (), QString (" Address:" ));
199
+ QVERIFY (address.isEmpty ());
200
+ address = receiveRequestDialog->QObject ::findChild<QLabel*>(" address_content" )->text ();
201
+ QVERIFY (!address.isEmpty ());
198
202
199
203
QCOMPARE (uri.count (" amount=0.00000001" ), 2 );
200
204
QCOMPARE (receiveRequestDialog->QObject ::findChild<QLabel*>(" amount_tag" )->text (), QString (" Amount:" ));
@@ -221,13 +225,31 @@ void TestGUI(interfaces::Node& node)
221
225
int currentRowCount = requestTableModel->rowCount ({});
222
226
QCOMPARE (currentRowCount, initialRowCount+1 );
223
227
228
+ // Check addition to wallet
229
+ std::vector<std::string> requests = walletModel.wallet ().getAddressReceiveRequests ();
230
+ QCOMPARE (requests.size (), size_t {1 });
231
+ RecentRequestEntry entry;
232
+ CDataStream{MakeUCharSpan (requests[0 ]), SER_DISK, CLIENT_VERSION} >> entry;
233
+ QCOMPARE (entry.nVersion , int {1 });
234
+ QCOMPARE (entry.id , int64_t {1 });
235
+ QVERIFY (entry.date .isValid ());
236
+ QCOMPARE (entry.recipient .address , address);
237
+ QCOMPARE (entry.recipient .label , QString{" TEST_LABEL_1" });
238
+ QCOMPARE (entry.recipient .amount , CAmount{1 });
239
+ QCOMPARE (entry.recipient .message , QString{" TEST_MESSAGE_1" });
240
+ QCOMPARE (entry.recipient .sPaymentRequest , std::string{});
241
+ QCOMPARE (entry.recipient .authenticatedMerchant , QString{});
242
+
224
243
// Check Remove button
225
244
QTableView* table = receiveCoinsDialog.findChild <QTableView*>(" recentRequestsView" );
226
245
table->selectRow (currentRowCount-1 );
227
246
QPushButton* removeRequestButton = receiveCoinsDialog.findChild <QPushButton*>(" removeRequestButton" );
228
247
removeRequestButton->click ();
229
248
QCOMPARE (requestTableModel->rowCount ({}), currentRowCount-1 );
230
249
RemoveWallet (wallet, std::nullopt );
250
+
251
+ // Check removal from wallet
252
+ QCOMPARE (walletModel.wallet ().getAddressReceiveRequests ().size (), size_t {0 });
231
253
}
232
254
233
255
} // namespace
0 commit comments