scamconfiguresettingswidgettest.cpp 912 Bytes
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
6
7
/*
   SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "scamconfiguresettingswidgettest.h"
#include "../scamconfiguresettingswidget.h"
Laurent Montel's avatar
Laurent Montel committed
8
#include <QHeaderView>
Laurent Montel's avatar
Laurent Montel committed
9
#include <QTest>
Laurent Montel's avatar
Laurent Montel committed
10
#include <QTreeWidget>
Laurent Montel's avatar
Laurent Montel committed
11
#include <QVBoxLayout>
Laurent Montel's avatar
Laurent Montel committed
12
13
14
15
16
17
18
19
20
QTEST_MAIN(ScamConfigureSettingsWidgetTest)
ScamConfigureSettingsWidgetTest::ScamConfigureSettingsWidgetTest(QObject *parent)
    : QObject{parent}
{
}

void ScamConfigureSettingsWidgetTest::shouldHaveDefaultValues()
{
    ScamConfigureSettingsWidget w;
Laurent Montel's avatar
Laurent Montel committed
21
22
23
    auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
    QVERIFY(mainLayout);
    QCOMPARE(mainLayout->contentsMargins(), {});
Laurent Montel's avatar
Laurent Montel committed
24
25
26

    auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("mTreeWidget"));
    QVERIFY(mTreeWidget);
Laurent Montel's avatar
Laurent Montel committed
27
28
    QVERIFY(!mTreeWidget->rootIsDecorated());
    QVERIFY(!mTreeWidget->header()->sectionsMovable());
Laurent Montel's avatar
Laurent Montel committed
29
}