File indexing completed on 2024-06-09 04:59:32
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 "threadmessagedialogtest.h" 0008 #include "threadwidget/threadmessagedialog.h" 0009 #include "threadwidget/threadmessagewidget.h" 0010 #include <QDialogButtonBox> 0011 #include <QStandardPaths> 0012 #include <QTest> 0013 #include <QVBoxLayout> 0014 0015 QTEST_MAIN(ThreadMessageDialogTest) 0016 ThreadMessageDialogTest::ThreadMessageDialogTest(QObject *parent) 0017 : QObject(parent) 0018 { 0019 QStandardPaths::setTestModeEnabled(true); 0020 } 0021 0022 void ThreadMessageDialogTest::shouldHaveDefaultValues() 0023 { 0024 ThreadMessageDialog w(nullptr); 0025 QVERIFY(!w.windowTitle().isEmpty()); 0026 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0027 QVERIFY(mainLayout); 0028 0029 auto mThreadMessageWidget = w.findChild<ThreadMessageWidget *>(QStringLiteral("mThreadMessageWidget")); 0030 QVERIFY(mThreadMessageWidget); 0031 0032 auto button = w.findChild<QDialogButtonBox *>(QStringLiteral("button")); 0033 QVERIFY(button); 0034 } 0035 0036 #include "moc_threadmessagedialogtest.cpp"