Keep validation errors visible after explicit join attempts
This commit is contained in:
1 parent
d730dee925
commit
ae4fb89bef
2 files changed
+11
-3
No files matched your search
@@ -107,15 +107,23 @@ private slots:
|
||||
QCOMPARE(edit->text(), m_link);
|
||||
}
|
||||
|
||||
void errorSurvivesPendingPreview_data() {
|
||||
QTest::addColumn<bool>("accepted");
|
||||
QTest::newRow("core-result") << true;
|
||||
QTest::newRow("validation") << false;
|
||||
}
|
||||
|
||||
void errorSurvivesPendingPreview() {
|
||||
QFETCH(bool, accepted);
|
||||
JoinDialog dialog(nullptr, nullptr);
|
||||
auto* edit = dialog.findChild<QLineEdit*>();
|
||||
auto* action = dialog.findChild<QPushButton*>("joinConnect");
|
||||
auto* status = dialog.findChild<QLabel*>("joinStatus");
|
||||
dialog.show(); QTRY_COMPARE(QApplication::activeModalWidget(), &dialog);
|
||||
edit->setText(m_link); QTest::mouseClick(action, Qt::LeftButton);
|
||||
result_callback(m_peer, 42, CHAT_CONNECT_ERROR, last_request);
|
||||
edit->setText(accepted ? m_link : QStringLiteral("utun://invalid")); QTest::mouseClick(action, Qt::LeftButton);
|
||||
if (accepted) result_callback(m_peer, 42, CHAT_CONNECT_ERROR, last_request);
|
||||
const QString error = status->text();
|
||||
QVERIFY(!error.isEmpty());
|
||||
QTest::qWait(500);
|
||||
QCOMPARE(status->text(), error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user