File indexing completed on 2024-12-22 04:45:34
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "administratorcustomuserstatuscreatedialogtest.h" 0008 #include "administratordialog/customuserstatus/administratorcustomuserstatuscreatedialog.h" 0009 #include "administratordialog/customuserstatus/administratorcustomuserstatuscreatewidget.h" 0010 #include <QDialogButtonBox> 0011 #include <QStandardPaths> 0012 #include <QTest> 0013 #include <QVBoxLayout> 0014 0015 QTEST_MAIN(AdministratorCustomUserStatusCreateDialogTest) 0016 0017 AdministratorCustomUserStatusCreateDialogTest::AdministratorCustomUserStatusCreateDialogTest(QObject *parent) 0018 : QObject(parent) 0019 { 0020 QStandardPaths::setTestModeEnabled(true); 0021 } 0022 0023 void AdministratorCustomUserStatusCreateDialogTest::shouldHaveDefaultValues() 0024 { 0025 AdministratorCustomUserStatusCreateDialog w; 0026 QVERIFY(!w.windowTitle().isEmpty()); 0027 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0028 QVERIFY(mainLayout); 0029 0030 auto mCreateWidget = w.findChild<AdministratorCustomUserStatusCreateWidget *>(QStringLiteral("mCreateWidget")); 0031 QVERIFY(mCreateWidget); 0032 0033 auto buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("button")); 0034 QVERIFY(buttonBox); 0035 0036 QVERIFY(!w.userStatusInfo().isValid()); 0037 } 0038 0039 #include "moc_administratorcustomuserstatuscreatedialogtest.cpp"