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

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 "administratoroauthcreatewidgettest.h"
0008 #include "administratordialog/oauth/administratoroauthcreatewidget.h"
0009 #include <QCheckBox>
0010 #include <QFormLayout>
0011 #include <QLineEdit>
0012 #include <QTest>
0013 QTEST_MAIN(AdministratorOauthCreateWidgetTest)
0014 AdministratorOauthCreateWidgetTest::AdministratorOauthCreateWidgetTest(QObject *parent)
0015     : QObject{parent}
0016 {
0017 }
0018 
0019 void AdministratorOauthCreateWidgetTest::shouldHaveDefaultValues()
0020 {
0021     AdministratorOauthCreateWidget w;
0022     auto mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainLayout"));
0023     QVERIFY(mainLayout);
0024 
0025     auto mActiveCheckBox = w.findChild<QCheckBox *>(QStringLiteral("mActiveCheckBox"));
0026     QVERIFY(mActiveCheckBox);
0027     QVERIFY(!mActiveCheckBox->text().isEmpty());
0028     QVERIFY(!mActiveCheckBox->isChecked());
0029 
0030     auto mApplicationName = w.findChild<QLineEdit *>(QStringLiteral("mApplicationName"));
0031     QVERIFY(mApplicationName);
0032     QVERIFY(mApplicationName->text().isEmpty());
0033 
0034     auto mRedirectUrl = w.findChild<QLineEdit *>(QStringLiteral("mRedirectUrl"));
0035     QVERIFY(mRedirectUrl);
0036     QVERIFY(mRedirectUrl->text().isEmpty());
0037 }
0038 
0039 #include "moc_administratoroauthcreatewidgettest.cpp"