File indexing completed on 2024-11-24 04:39:30
0001 /* 0002 This file is part of Contact Editor. 0003 0004 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #include "messageformattingwidgettest.h" 0010 #include "../messageformattingwidget.h" 0011 #include <QCheckBox> 0012 #include <QComboBox> 0013 #include <QLabel> 0014 #include <QTest> 0015 0016 MessageFormattingWidgetTest::MessageFormattingWidgetTest(QObject *parent) 0017 : QObject(parent) 0018 { 0019 } 0020 0021 void MessageFormattingWidgetTest::shouldHaveDefaultValue() 0022 { 0023 Akonadi::MessageFormattingWidget w; 0024 0025 auto label = w.findChild<QLabel *>(QStringLiteral("label")); 0026 QVERIFY(label); 0027 QVERIFY(!label->text().isEmpty()); 0028 0029 auto mMailPreferFormatting = w.findChild<QComboBox *>(QStringLiteral("mMailPreferFormatting")); 0030 QVERIFY(mMailPreferFormatting); 0031 QVERIFY(mMailPreferFormatting->count() > 0); 0032 0033 auto mAllowRemoteContent = w.findChild<QCheckBox *>(QStringLiteral("mAllowRemoteContent")); 0034 QVERIFY(mAllowRemoteContent); 0035 QVERIFY(!mAllowRemoteContent->text().isEmpty()); 0036 QVERIFY(!mAllowRemoteContent->isChecked()); 0037 } 0038 0039 QTEST_MAIN(MessageFormattingWidgetTest) 0040 0041 #include "moc_messageformattingwidgettest.cpp"