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");
triggerAction("actionDatabaseSettings");
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 advancedToggle = dbSettingsDialog->findChild<QCheckBox*>("advancedSettingsToggle");
advancedToggle->setChecked(true);
QApplication::processEvents();
dbSettingsCategoryList->setCurrentCategory(1); // go into security category
dbSettingsStackedWidget->findChild<QTabWidget*>()->setCurrentIndex(1); // go into encryption tab
QVERIFY(transformRoundsSpinBox != nullptr);
transformRoundsSpinBox->setValue(123456);
QTest::keyClick(transformRoundsSpinBox, Qt::Key_Enter);