File indexing completed on 2025-07-13 04:35:47

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 "myaccount2e2configurewidgettest.h"
0008 #include "misc/passwordconfirmwidget.h"
0009 #include "myaccount/myaccount2e2configurewidget.h"
0010 #include <QLabel>
0011 #include <QPushButton>
0012 #include <QTest>
0013 #include <QVBoxLayout>
0014 QTEST_MAIN(MyAccount2e2ConfigureWidgetTest)
0015 
0016 MyAccount2e2ConfigureWidgetTest::MyAccount2e2ConfigureWidgetTest(QObject *parent)
0017     : QObject{parent}
0018 {
0019 }
0020 
0021 void MyAccount2e2ConfigureWidgetTest::shouldHaveDefaultValues()
0022 {
0023     MyAccount2e2ConfigureWidget w(nullptr);
0024     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0025     QVERIFY(mainLayout);
0026 
0027     auto changePasswordLabel = w.findChild<QLabel *>(QStringLiteral("removePasswordlabel"));
0028     QVERIFY(changePasswordLabel);
0029     QVERIFY(!changePasswordLabel->text().isEmpty());
0030     QVERIFY(changePasswordLabel->wordWrap());
0031 
0032     auto mResetE2eKey = w.findChild<QPushButton *>(QStringLiteral("mResetE2eKey"));
0033     QVERIFY(mResetE2eKey);
0034     QVERIFY(!mResetE2eKey->text().isEmpty());
0035 
0036     auto removePasswordlabel = w.findChild<QLabel *>(QStringLiteral("removePasswordlabel"));
0037     QVERIFY(removePasswordlabel);
0038     QVERIFY(!removePasswordlabel->text().isEmpty());
0039     QVERIFY(removePasswordlabel->wordWrap());
0040 
0041     auto mPasswordConfirmWidget = w.findChild<PasswordConfirmWidget *>(QStringLiteral("mPasswordConfirmWidget"));
0042     QVERIFY(mPasswordConfirmWidget);
0043 }
0044 
0045 #include "moc_myaccount2e2configurewidgettest.cpp"