File indexing completed on 2024-12-22 04:45:40

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "administratorsettingsdialogtest.h"
0008 #include "administratorsettingsdialog/administratorsettingsdialog.h"
0009 #include "administratorsettingsdialog/administratorsettingswidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QStandardPaths>
0012 #include <QTest>
0013 #include <QVBoxLayout>
0014 QTEST_MAIN(AdministratorSettingsDialogTest)
0015 
0016 AdministratorSettingsDialogTest::AdministratorSettingsDialogTest(QObject *parent)
0017     : QObject{parent}
0018 {
0019     QStandardPaths::setTestModeEnabled(true);
0020 }
0021 
0022 void AdministratorSettingsDialogTest::shouldHaveDefaultValues()
0023 {
0024     AdministratorSettingsDialog d(nullptr);
0025     QVERIFY(!d.windowTitle().isEmpty());
0026 
0027     auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0028     QVERIFY(mainLayout);
0029 
0030     auto mAdministratorSettingsWidget = d.findChild<AdministratorSettingsWidget *>(QStringLiteral("mAdministratorSettingsWidget"));
0031     QVERIFY(mAdministratorSettingsWidget);
0032 
0033     auto button = d.findChild<QDialogButtonBox *>(QStringLiteral("button"));
0034     QVERIFY(button);
0035 }
0036 
0037 #include "moc_administratorsettingsdialogtest.cpp"