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

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "filteractionmissingaccountdialogtest.h"
0008 #include "../filter/dialog/filteractionmissingaccountdialog.h"
0009 #include "../filter/kmfilteraccountlist.h"
0010 #include <QDialogButtonBox>
0011 #include <QLabel>
0012 #include <QStandardPaths>
0013 #include <QTest>
0014 
0015 FilterActionMissingAccountDialogTest::FilterActionMissingAccountDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018     QStandardPaths::setTestModeEnabled(true);
0019 }
0020 
0021 FilterActionMissingAccountDialogTest::~FilterActionMissingAccountDialogTest() = default;
0022 
0023 void FilterActionMissingAccountDialogTest::shouldHaveDefaultValue()
0024 {
0025     MailCommon::FilterActionMissingAccountDialog dlg(QStringList(), QStringLiteral("filename"));
0026     QVERIFY(!dlg.windowTitle().isEmpty());
0027     QVERIFY(dlg.isModal());
0028 
0029     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
0030     QVERIFY(buttonBox);
0031 
0032     auto label = dlg.findChild<QLabel *>(QStringLiteral("label"));
0033     QVERIFY(label);
0034     QVERIFY(!label->text().isEmpty());
0035 
0036     auto mAccountList = dlg.findChild<MailCommon::KMFilterAccountList *>(QStringLiteral("accountlist"));
0037     QVERIFY(mAccountList);
0038 }
0039 
0040 QTEST_MAIN(FilterActionMissingAccountDialogTest)
0041 
0042 #include "moc_filteractionmissingaccountdialogtest.cpp"