File indexing completed on 2024-12-22 04:45:34
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "administratordirectroomseditwidgettest.h" 0008 #include "administratordialog/rooms/administratordirectroomseditwidget.h" 0009 #include <QCheckBox> 0010 #include <QFormLayout> 0011 #include <QLineEdit> 0012 #include <QTest> 0013 QTEST_MAIN(AdministratorDirectRoomsEditWidgetTest) 0014 AdministratorDirectRoomsEditWidgetTest::AdministratorDirectRoomsEditWidgetTest(QObject *parent) 0015 : QObject{parent} 0016 { 0017 } 0018 0019 void AdministratorDirectRoomsEditWidgetTest::shouldHaveDefaultValues() 0020 { 0021 AdministratorDirectRoomsEditWidget w; 0022 auto mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainLayout")); 0023 QVERIFY(mainLayout); 0024 0025 auto mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("mLineEdit")); 0026 QVERIFY(mLineEdit); 0027 QVERIFY(mLineEdit->text().isEmpty()); 0028 0029 auto mDefaultCheckBox = w.findChild<QCheckBox *>(QStringLiteral("mDefaultCheckBox")); 0030 QVERIFY(mDefaultCheckBox); 0031 QVERIFY(!mDefaultCheckBox->isChecked()); 0032 QVERIFY(!mDefaultCheckBox->text().isEmpty()); 0033 0034 auto mFavoriteCheckBox = w.findChild<QCheckBox *>(QStringLiteral("mFavoriteCheckBox")); 0035 QVERIFY(mFavoriteCheckBox); 0036 QVERIFY(!mFavoriteCheckBox->isChecked()); 0037 QVERIFY(!mFavoriteCheckBox->text().isEmpty()); 0038 0039 auto mFeaturedCheckBox = w.findChild<QCheckBox *>(QStringLiteral("mFeaturedCheckBox")); 0040 QVERIFY(mFeaturedCheckBox); 0041 QVERIFY(!mFeaturedCheckBox->isChecked()); 0042 QVERIFY(!mFeaturedCheckBox->text().isEmpty()); 0043 } 0044 0045 #include "moc_administratordirectroomseditwidgettest.cpp"