File indexing completed on 2026-05-10 12:33:34

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "prunemessagesdialogtest.h"
0008 #include "prunemessages/prunemessagesdialog.h"
0009 #include "prunemessages/prunemessageswidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QStandardPaths>
0012 #include <QTest>
0013 #include <QVBoxLayout>
0014 QTEST_MAIN(PruneMessagesDialogTest)
0015 
0016 PruneMessagesDialogTest::PruneMessagesDialogTest(QObject *parent)
0017     : QObject(parent)
0018 {
0019     QStandardPaths::setTestModeEnabled(true);
0020 }
0021 
0022 void PruneMessagesDialogTest::shouldHaveDefaultValues()
0023 {
0024     PruneMessagesDialog d(nullptr);
0025     QVERIFY(!d.windowTitle().isEmpty());
0026 
0027     auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0028     QVERIFY(mainLayout);
0029 
0030     auto mPruneMessageWidget = d.findChild<PruneMessagesWidget *>(QStringLiteral("mPruneMessageWidget"));
0031     QVERIFY(mPruneMessageWidget);
0032 
0033     auto button = d.findChild<QDialogButtonBox *>(QStringLiteral("button"));
0034     QVERIFY(button);
0035 }
0036 
0037 #include "moc_prunemessagesdialogtest.cpp"