File indexing completed on 2024-12-22 04:45:35
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 "permissionseditwidgettest.h" 0008 #include "administratordialog/permissions/permissionseditwidget.h" 0009 #include "misc/rolescombobox.h" 0010 #include <QHBoxLayout> 0011 #include <QLabel> 0012 #include <QTest> 0013 QTEST_MAIN(PermissionsEditWidgetTest) 0014 PermissionsEditWidgetTest::PermissionsEditWidgetTest(QObject *parent) 0015 : QObject(parent) 0016 { 0017 } 0018 0019 void PermissionsEditWidgetTest::shouldHaveDefaultValues() 0020 { 0021 PermissionsEditWidget w; 0022 auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout")); 0023 QVERIFY(mainLayout); 0024 QCOMPARE(mainLayout->contentsMargins(), QMargins{}); 0025 0026 auto label = w.findChild<QLabel *>(QStringLiteral("label")); 0027 QVERIFY(label); 0028 QVERIFY(!label->text().isEmpty()); 0029 0030 auto mRolesCombobox = w.findChild<RolesComboBox *>(QStringLiteral("mRolesCombobox")); 0031 QVERIFY(mRolesCombobox); 0032 } 0033 0034 #include "moc_permissionseditwidgettest.cpp"