File indexing completed on 2025-03-09 04:54:37
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #include "remotecontentconfigurewidgettest.h" 0007 #include "remote-content/remotecontentconfigurewidget.h" 0008 #include <KTreeWidgetSearchLine> 0009 #include <QStandardPaths> 0010 #include <QTest> 0011 #include <QVBoxLayout> 0012 0013 QTEST_MAIN(RemoteContentConfigureWidgetTest) 0014 RemoteContentConfigureWidgetTest::RemoteContentConfigureWidgetTest(QObject *parent) 0015 : QObject(parent) 0016 { 0017 QStandardPaths::setTestModeEnabled(true); 0018 } 0019 0020 void RemoteContentConfigureWidgetTest::shouldHaveDefaultValues() 0021 { 0022 MessageViewer::RemoteContentConfigureWidget w; 0023 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0024 QVERIFY(mainLayout); 0025 QCOMPARE(mainLayout->contentsMargins(), QMargins{}); 0026 0027 auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("treewidget")); 0028 QVERIFY(mTreeWidget); 0029 QVERIFY(mTreeWidget->alternatingRowColors()); 0030 QVERIFY(!mTreeWidget->rootIsDecorated()); 0031 0032 auto searchLineEdit = w.findChild<KTreeWidgetSearchLine *>(QStringLiteral("searchlineedit")); 0033 QVERIFY(searchLineEdit); 0034 QVERIFY(searchLineEdit->isClearButtonEnabled()); 0035 } 0036 0037 #include "moc_remotecontentconfigurewidgettest.cpp"