Fix TestGui::testDatabaseSettings open tab missing (#9162)

Co-authored-by: jNullj <jNullj@users.noreply.github.com>
This commit is contained in:
jNullj 2023-02-25 21:11:18 +02:00 committed by GitHub
parent 1129986f18
commit 7a6505626f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1462,12 +1462,16 @@ void TestGui::testDatabaseSettings()
m_db->metadata()->setName("testDatabaseSettings"); m_db->metadata()->setName("testDatabaseSettings");
triggerAction("actionDatabaseSettings"); triggerAction("actionDatabaseSettings");
auto* dbSettingsDialog = m_dbWidget->findChild<QWidget*>("databaseSettingsDialog"); auto* dbSettingsDialog = m_dbWidget->findChild<QWidget*>("databaseSettingsDialog");
auto* dbSettingsCategoryList = dbSettingsDialog->findChild<CategoryListWidget*>("categoryList");
auto* dbSettingsStackedWidget = dbSettingsDialog->findChild<QStackedWidget*>("stackedWidget");
auto* transformRoundsSpinBox = dbSettingsDialog->findChild<QSpinBox*>("transformRoundsSpinBox"); auto* transformRoundsSpinBox = dbSettingsDialog->findChild<QSpinBox*>("transformRoundsSpinBox");
auto advancedToggle = dbSettingsDialog->findChild<QCheckBox*>("advancedSettingsToggle"); auto advancedToggle = dbSettingsDialog->findChild<QCheckBox*>("advancedSettingsToggle");
advancedToggle->setChecked(true); advancedToggle->setChecked(true);
QApplication::processEvents(); QApplication::processEvents();
dbSettingsCategoryList->setCurrentCategory(1); // go into security category
dbSettingsStackedWidget->findChild<QTabWidget*>()->setCurrentIndex(1); // go into encryption tab
QVERIFY(transformRoundsSpinBox != nullptr); QVERIFY(transformRoundsSpinBox != nullptr);
transformRoundsSpinBox->setValue(123456); transformRoundsSpinBox->setValue(123456);
QTest::keyClick(transformRoundsSpinBox, Qt::Key_Enter); QTest::keyClick(transformRoundsSpinBox, Qt::Key_Enter);