message: test: Add gui test for wallet receive requests
  Make sure wallet receive requests are saved and deleted correctly by GUI
  code
diff: @@ -214,6 +214,7 @@ void TestGUI(interfaces::Node& node)
  int initialRowCount = requestTableModel->rowCount({});
  QPushButton* requestPaymentButton = receiveCoinsDialog.findChild<QPushButton*>("receiveButton");
  requestPaymentButton->click();
  + QString address;
  for (QWidget* widget : QApplication::topLevelWidgets()) {
  if (widget->inherits("ReceiveRequestDialog")) {
  ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);
  @@ -222,6 +223,9 @@ void TestGUI(interfaces::Node& node)
  QString uri = receiveRequestDialog->QObject::findChild<QLabel*>("uri_content")->text();
  QCOMPARE(uri.count("bitcoin:"), 2);
  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("address_tag")->text(), QString("Address:"));
  + QVERIFY(address.isEmpty());
  + address = receiveRequestDialog->QObject::findChild<QLabel*>("address_content")->text();
  + QVERIFY(!address.isEmpty());
  QCOMPARE(uri.count("amount=0.00000001"), 2);
  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("amount_tag")->text(), QString("Amount:"));
  @@ -248,12 +252,30 @@ void TestGUI(interfaces::Node& node)
  int currentRowCount = requestTableModel->rowCount({});
  QCOMPARE(currentRowCount, initialRowCount+1);
  + // Check addition to wallet
  + std::vector<std::string> requests = walletModel.wallet().getDestValues("rr");
  + QCOMPARE(requests.size(), size_t{1});
  + RecentRequestEntry entry;
  + CDataStream{MakeUCharSpan(requests[0]), SER_DISK, CLIENT_VERSION} >> entry;
  + QCOMPARE(entry.nVersion, int{1});
  + QCOMPARE(entry.id, int64_t{1});
  + QVERIFY(entry.date.isValid());
  + QCOMPARE(entry.recipient.address, address);
  + QCOMPARE(entry.recipient.label, QString{"TEST_LABEL_1"});
  + QCOMPARE(entry.recipient.amount, CAmount{1});
  + QCOMPARE(entry.recipient.message, QString{"TEST_MESSAGE_1"});
  + QCOMPARE(entry.recipient.sPaymentRequest, std::string{});
  + QCOMPARE(entry.recipient.authenticatedMerchant, QString{});
  +
  // Check Remove button
  QTableView* table = receiveCoinsDialog.findChild<QTableView*>("recentRequestsView");
  table->selectRow(currentRowCount-1);
  QPushButton* removeRequestButton = receiveCoinsDialog.findChild<QPushButton*>("removeRequestButton");
  removeRequestButton->click();
  QCOMPARE(requestTableModel->rowCount({}), currentRowCount-1);
  +
  + // Check removal from wallet
  + QCOMPARE(walletModel.wallet().getDestValues("rr").size(), size_t{0});
  }
  } // namespace
  