File indexing completed on 2025-01-19 04:46:51

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "dkimadvancedwidgettest.h"
0008 #include "dkimadvancedwidget.h"
0009 #include <QCheckBox>
0010 #include <QComboBox>
0011 #include <QFormLayout>
0012 #include <QTest>
0013 QTEST_MAIN(DKIMAdvancedWidgetTest)
0014 
0015 DKIMAdvancedWidgetTest::DKIMAdvancedWidgetTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void DKIMAdvancedWidgetTest::shouldHaveDefaultValues()
0021 {
0022     DKIMAdvancedWidget w;
0023     auto mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainLayout"));
0024     QVERIFY(mainLayout);
0025 
0026     auto mCheckDKIMWhenOnlyTesting = w.findChild<QCheckBox *>(QStringLiteral("kcfg_VerifySignatureWhenOnlyTest"));
0027     QVERIFY(mCheckDKIMWhenOnlyTesting);
0028     QVERIFY(!mCheckDKIMWhenOnlyTesting->text().isEmpty());
0029 
0030     auto mUseAuthenticationResultRelaxedParser = w.findChild<QCheckBox *>(QStringLiteral("kcfg_UseRelaxedParsingAuthenticationResults"));
0031     QVERIFY(mUseAuthenticationResultRelaxedParser);
0032     QVERIFY(!mUseAuthenticationResultRelaxedParser->text().isEmpty());
0033 
0034     auto mSha1Policy = w.findChild<QComboBox *>(QStringLiteral("kcfg_PolicyRsaSha1"));
0035     QVERIFY(mSha1Policy);
0036     QVERIFY(mSha1Policy->count() > 0);
0037 
0038     auto mSmallKeyPolicy = w.findChild<QComboBox *>(QStringLiteral("kcfg_PublicRsaTooSmall"));
0039     QVERIFY(mSmallKeyPolicy);
0040     QVERIFY(mSmallKeyPolicy->count() > 0);
0041 }
0042 
0043 #include "moc_dkimadvancedwidgettest.cpp"