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 "filteractionmissingtransportdialogtest.h"
0008 #include "../filter/dialog/filteractionmissingtransportdialog.h"
0009 
0010 #include <QDialogButtonBox>
0011 #include <QLabel>
0012 #include <QStandardPaths>
0013 #include <QTest>
0014 
0015 #include <MailTransport/TransportComboBox>
0016 
0017 FilterActionMissingTransportDialogTest::FilterActionMissingTransportDialogTest(QObject *parent)
0018     : QObject(parent)
0019 {
0020     QStandardPaths::setTestModeEnabled(true);
0021 }
0022 
0023 FilterActionMissingTransportDialogTest::~FilterActionMissingTransportDialogTest() = default;
0024 
0025 void FilterActionMissingTransportDialogTest::shouldHaveDefaultValue()
0026 {
0027     MailCommon::FilterActionMissingTransportDialog dlg(QStringLiteral("filename"));
0028     QVERIFY(!dlg.windowTitle().isEmpty());
0029     QVERIFY(dlg.isModal());
0030     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
0031     QVERIFY(buttonBox);
0032 
0033     auto label = dlg.findChild<QLabel *>(QStringLiteral("label"));
0034     QVERIFY(label);
0035     QVERIFY(!label->text().isEmpty());
0036     auto mComboBoxTransport = dlg.findChild<MailTransport::TransportComboBox *>(QStringLiteral("comboboxtransport"));
0037     QVERIFY(mComboBoxTransport);
0038 }
0039 
0040 QTEST_MAIN(FilterActionMissingTransportDialogTest)
0041 
0042 #include "moc_filteractionmissingtransportdialogtest.cpp"