File indexing completed on 2024-12-22 04:46:13
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #include "whatsnewdialogtest.h" 0007 #include "whatsnew/whatsnewdialog.h" 0008 #include "whatsnew/whatsnewwidget.h" 0009 #include <QDialogButtonBox> 0010 #include <QStandardPaths> 0011 #include <QTest> 0012 #include <QVBoxLayout> 0013 QTEST_MAIN(WhatsNewDialogTest) 0014 WhatsNewDialogTest::WhatsNewDialogTest(QObject *parent) 0015 : QObject{parent} 0016 { 0017 QStandardPaths::setTestModeEnabled(true); 0018 } 0019 0020 void WhatsNewDialogTest::shouldHaveDefaultValues() 0021 { 0022 WhatsNewDialog d; 0023 QVERIFY(!d.windowTitle().isEmpty()); 0024 auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0025 QVERIFY(mainLayout); 0026 auto mWhatsNewWidget = d.findChild<WhatsNewWidget *>(QStringLiteral("mWhatsNewWidget")); 0027 QVERIFY(mWhatsNewWidget); 0028 0029 auto button = d.findChild<QDialogButtonBox *>(QStringLiteral("button")); 0030 QVERIFY(button); 0031 } 0032 0033 #include "moc_whatsnewdialogtest.cpp"