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 "filteractionmissingsoundurldialogtest.h"
0008 #include "../filter/dialog/filteractionmissingsoundurldialog.h"
0009 #include <KUrlRequester>
0010 #include <QDialogButtonBox>
0011 #include <QLabel>
0012 #include <QStandardPaths>
0013 #include <QTest>
0014 
0015 FilterActionMissingSoundUrlDialogTest::FilterActionMissingSoundUrlDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018     QStandardPaths::setTestModeEnabled(true);
0019 }
0020 
0021 FilterActionMissingSoundUrlDialogTest::~FilterActionMissingSoundUrlDialogTest() = default;
0022 
0023 void FilterActionMissingSoundUrlDialogTest::shouldHaveDefaultValue()
0024 {
0025     MailCommon::FilterActionMissingSoundUrlDialog dlg(QStringLiteral("filename"), QStringLiteral("arg"));
0026     QVERIFY(!dlg.windowTitle().isEmpty());
0027 
0028     auto buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
0029     QVERIFY(buttonBox);
0030 
0031     auto label = dlg.findChild<QLabel *>(QStringLiteral("oldlabel"));
0032     QVERIFY(label);
0033     QVERIFY(!label->text().isEmpty());
0034 
0035     label = dlg.findChild<QLabel *>(QStringLiteral("selectlabel"));
0036     QVERIFY(label);
0037     QVERIFY(!label->text().isEmpty());
0038 
0039     auto mUrlWidget = dlg.findChild<KUrlRequester *>(QStringLiteral("urlwidget"));
0040     QVERIFY(mUrlWidget);
0041 }
0042 
0043 QTEST_MAIN(FilterActionMissingSoundUrlDialogTest)
0044 
0045 #include "moc_filteractionmissingsoundurldialogtest.cpp"