File indexing completed on 2024-11-10 04:50:01

0001 /*
0002   SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only
0005 */
0006 
0007 #include "filteractionsendfakedispositiontest.h"
0008 #include "../filteractions/filteractionsendfakedisposition.h"
0009 #include <QComboBox>
0010 #include <QTest>
0011 
0012 FilterActionSendFakeDispositionTest::FilterActionSendFakeDispositionTest(QObject *parent)
0013     : QObject(parent)
0014 {
0015 }
0016 
0017 FilterActionSendFakeDispositionTest::~FilterActionSendFakeDispositionTest() = default;
0018 
0019 void FilterActionSendFakeDispositionTest::shouldHaveDefaultValue()
0020 {
0021     MailCommon::FilterActionSendFakeDisposition filter;
0022     QWidget *w = filter.createParamWidget(nullptr);
0023     QCOMPARE(w->objectName(), QStringLiteral("combobox"));
0024 
0025     auto comboBox = dynamic_cast<QComboBox *>(w);
0026     QVERIFY(comboBox);
0027     QVERIFY(!comboBox->isEditable());
0028     QVERIFY(comboBox->count() > 0);
0029 }
0030 
0031 void FilterActionSendFakeDispositionTest::shouldBeEmpty()
0032 {
0033     MailCommon::FilterActionSendFakeDisposition filter;
0034     QVERIFY(filter.isEmpty());
0035 }
0036 
0037 void FilterActionSendFakeDispositionTest::shouldHaveRequiredPart()
0038 {
0039     MailCommon::FilterActionSendFakeDisposition filter;
0040     QCOMPARE(filter.requiredPart(), MailCommon::SearchRule::CompleteMessage);
0041 }
0042 
0043 QTEST_MAIN(FilterActionSendFakeDispositionTest)
0044 
0045 #include "moc_filteractionsendfakedispositiontest.cpp"