File indexing completed on 2024-12-22 05:00:49
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 "archivemailwidgettest.h" 0008 #include "../archivemailwidget.h" 0009 0010 #include <QStandardPaths> 0011 #include <QTest> 0012 #include <QTreeWidget> 0013 0014 ArchiveMailWidgetTest::ArchiveMailWidgetTest(QObject *parent) 0015 : QObject(parent) 0016 { 0017 QStandardPaths::setTestModeEnabled(true); 0018 } 0019 0020 ArchiveMailWidgetTest::~ArchiveMailWidgetTest() = default; 0021 0022 void ArchiveMailWidgetTest::shouldHaveDefaultValue() 0023 { 0024 QWidget parent; 0025 new QHBoxLayout(&parent); 0026 ArchiveMailWidget mailwidget({}, &parent, {QStringLiteral("akonadi_archivemail_agent")}); 0027 0028 auto treeWidget = parent.findChild<QTreeWidget *>(QStringLiteral("treewidget")); 0029 QVERIFY(treeWidget); 0030 0031 QCOMPARE(treeWidget->topLevelItemCount(), 0); 0032 } 0033 0034 QTEST_MAIN(ArchiveMailWidgetTest) 0035 0036 #include "moc_archivemailwidgettest.cpp"