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

0001 /*
0002   SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only
0005 */
0006 
0007 #include "filteractionexectest.h"
0008 #include "../filteractions/filteractionexec.h"
0009 #include "../filteractions/filteractionwithurl.h"
0010 #include <QTest>
0011 
0012 #include <KUrlRequester>
0013 
0014 FilterActionExecTest::FilterActionExecTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 FilterActionExecTest::~FilterActionExecTest() = default;
0020 
0021 void FilterActionExecTest::shouldHaveDefaultValue()
0022 {
0023     MailCommon::FilterActionExec filter;
0024     QWidget *w = filter.createParamWidget(nullptr);
0025     auto requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
0026     QVERIFY(requester);
0027 
0028     auto helpButton = w->findChild<MailCommon::FilterActionWithUrlHelpButton *>(QStringLiteral("helpbutton"));
0029     QVERIFY(helpButton);
0030 }
0031 
0032 void FilterActionExecTest::shouldHaveRequirePart()
0033 {
0034     MailCommon::FilterActionExec filter;
0035     QCOMPARE(filter.requiredPart(), MailCommon::SearchRule::CompleteMessage);
0036 }
0037 
0038 QTEST_MAIN(FilterActionExecTest)
0039 
0040 #include "moc_filteractionexectest.cpp"