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 "filteractionmovetest.h"
0008 #include "../filteractions/filteractionmove.h"
0009 #include "folder/folderrequester.h"
0010 #include <QTest>
0011 
0012 FilterActionMoveTest::FilterActionMoveTest(QObject *parent)
0013     : QObject(parent)
0014 {
0015 }
0016 
0017 FilterActionMoveTest::~FilterActionMoveTest() = default;
0018 
0019 void FilterActionMoveTest::shouldHaveSieveRequires()
0020 {
0021     MailCommon::FilterActionMove filter;
0022     QCOMPARE(filter.sieveRequires(), QStringList() << QStringLiteral("fileinto"));
0023 }
0024 
0025 void FilterActionMoveTest::shouldHaveRequiresPart()
0026 {
0027     MailCommon::FilterActionMove filter;
0028     QCOMPARE(filter.requiredPart(), MailCommon::SearchRule::Envelope);
0029 }
0030 
0031 void FilterActionMoveTest::shouldHaveDefaultValue()
0032 {
0033     MailCommon::FilterActionMove filter;
0034     QWidget *w = filter.createParamWidget(nullptr);
0035     QVERIFY(w);
0036     auto requester = dynamic_cast<MailCommon::FolderRequester *>(w);
0037     QVERIFY(requester);
0038     QCOMPARE(requester->objectName(), QStringLiteral("folderrequester"));
0039 }
0040 
0041 QTEST_MAIN(FilterActionMoveTest)
0042 
0043 #include "moc_filteractionmovetest.cpp"