File indexing completed on 2025-01-05 04:49:42

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #include "scamconfiguresettingswidgettest.h"
0007 #include "../scamconfiguresettingswidget.h"
0008 #include <QHeaderView>
0009 #include <QTest>
0010 #include <QTreeWidget>
0011 #include <QVBoxLayout>
0012 QTEST_MAIN(ScamConfigureSettingsWidgetTest)
0013 ScamConfigureSettingsWidgetTest::ScamConfigureSettingsWidgetTest(QObject *parent)
0014     : QObject{parent}
0015 {
0016 }
0017 
0018 void ScamConfigureSettingsWidgetTest::shouldHaveDefaultValues()
0019 {
0020     ScamConfigureSettingsWidget w;
0021     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0022     QVERIFY(mainLayout);
0023     QCOMPARE(mainLayout->contentsMargins(), QMargins{});
0024 
0025     auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("mTreeWidget"));
0026     QVERIFY(mTreeWidget);
0027     QVERIFY(!mTreeWidget->rootIsDecorated());
0028     QVERIFY(!mTreeWidget->header()->sectionsMovable());
0029 }
0030 
0031 #include "moc_scamconfiguresettingswidgettest.cpp"