File indexing completed on 2024-06-09 04:59:03

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 "asktwoauthenticationpasswordwidgettest.h"
0008 #include "dialogs/asktwoauthenticationpasswordwidget.h"
0009 #include "misc/twoauthenticationpasswordwidget.h"
0010 #include <QTest>
0011 #include <QVBoxLayout>
0012 QTEST_MAIN(AskTwoAuthenticationPasswordWidgetTest)
0013 
0014 AskTwoAuthenticationPasswordWidgetTest::AskTwoAuthenticationPasswordWidgetTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 void AskTwoAuthenticationPasswordWidgetTest::shouldHaveDefaultValues()
0020 {
0021     AskTwoAuthenticationPasswordWidget w;
0022 
0023     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0024     QVERIFY(mainLayout);
0025     QCOMPARE(mainLayout->contentsMargins(), QMargins());
0026 
0027     auto mTwoFactorAuthenticationPasswordLineEdit = w.findChild<TwoAuthenticationPasswordWidget *>(QStringLiteral("mTwoFactorAuthenticationPasswordLineEdit"));
0028     QVERIFY(mTwoFactorAuthenticationPasswordLineEdit);
0029     QVERIFY(mTwoFactorAuthenticationPasswordLineEdit->code().isEmpty());
0030     QVERIFY(!mTwoFactorAuthenticationPasswordLineEdit->rocketChatAccount());
0031     QVERIFY(!w.rocketChatAccount());
0032 }
0033 
0034 #include "moc_asktwoauthenticationpasswordwidgettest.cpp"