File indexing completed on 2025-01-12 04:34:20
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "configurefontwidgettest.h" 0008 #include "configuredialog/configurefontwidget.h" 0009 #include <KFontChooser> 0010 #include <QCheckBox> 0011 #include <QStandardPaths> 0012 #include <QTest> 0013 #include <QVBoxLayout> 0014 QTEST_MAIN(ConfigureFontWidgetTest) 0015 0016 ConfigureFontWidgetTest::ConfigureFontWidgetTest(QObject *parent) 0017 : QObject(parent) 0018 { 0019 QStandardPaths::setTestModeEnabled(true); 0020 } 0021 0022 void ConfigureFontWidgetTest::shouldHaveDefaultValues() 0023 { 0024 ConfigureFontWidget w; 0025 auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout")); 0026 QVERIFY(mainLayout); 0027 0028 auto mCustomFontCheck = w.findChild<QCheckBox *>(QStringLiteral("mCustomFontCheck")); 0029 QVERIFY(mCustomFontCheck); 0030 QVERIFY(!mCustomFontCheck->isChecked()); 0031 0032 auto mFontChooser = w.findChild<KFontChooser *>(QStringLiteral("mFontChooser")); 0033 QVERIFY(mFontChooser); 0034 QVERIFY(!mFontChooser->isEnabled()); 0035 } 0036 0037 #include "moc_configurefontwidgettest.cpp"