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 "administratorcustomuserstatuscreatewidgettest.h"
0008 #include "administratordialog/customuserstatus/administratorcustomuserstatuscreatewidget.h"
0009 #include "misc/statuscombobox.h"
0010 #include <QFormLayout>
0011 #include <QLineEdit>
0012 #include <QTest>
0013 QTEST_MAIN(AdministratorCustomUserStatusCreateWidgetTest)
0014 AdministratorCustomUserStatusCreateWidgetTest::AdministratorCustomUserStatusCreateWidgetTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 void AdministratorCustomUserStatusCreateWidgetTest::shouldHaveDefaultValues()
0020 {
0021     AdministratorCustomUserStatusCreateWidget w;
0022 
0023     auto mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainLayout"));
0024     QVERIFY(mainLayout);
0025     QCOMPARE(mainLayout->contentsMargins(), QMargins());
0026 
0027     auto mName = w.findChild<QLineEdit *>(QStringLiteral("mName"));
0028     QVERIFY(mName);
0029     QVERIFY(mName->text().isEmpty());
0030     QVERIFY(mName->isClearButtonEnabled());
0031 
0032     auto mStatusCombobox = w.findChild<StatusCombobox *>(QStringLiteral("mStatusCombobox"));
0033     QVERIFY(mStatusCombobox);
0034     QVERIFY(!w.userStatusInfo().isValid());
0035 }
0036 
0037 #include "moc_administratorcustomuserstatuscreatewidgettest.cpp"