File indexing completed on 2024-10-27 04:50:48

0001 /*
0002    SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "sendlaterconfiguredialogtest.h"
0008 #include "../sendlaterconfiguredialog.h"
0009 #include "../sendlaterconfigurewidget.h"
0010 
0011 #include <QStandardPaths>
0012 #include <QTest>
0013 #include <QTreeWidget>
0014 
0015 SendLaterConfigureDialogTest::SendLaterConfigureDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 SendLaterConfigureDialogTest::~SendLaterConfigureDialogTest() = default;
0021 
0022 void SendLaterConfigureDialogTest::initTestCase()
0023 {
0024     QStandardPaths::setTestModeEnabled(true);
0025 }
0026 
0027 void SendLaterConfigureDialogTest::shouldHaveDefaultValue()
0028 {
0029     SendLaterConfigureDialog dlg;
0030     auto infowidget = dlg.findChild<SendLaterWidget *>(QStringLiteral("sendlaterwidget"));
0031     QVERIFY(infowidget);
0032 
0033     auto treeWidget = infowidget->findChild<QTreeWidget *>(QStringLiteral("treewidget"));
0034     QVERIFY(treeWidget);
0035 
0036     QCOMPARE(treeWidget->topLevelItemCount(), 0);
0037 }
0038 
0039 QTEST_MAIN(SendLaterConfigureDialogTest)
0040 
0041 #include "moc_sendlaterconfiguredialogtest.cpp"