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

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "gravatarconfiguresettingspluginwidgettest.h"
0008 #include "../gravatarconfiguresettingspluginwidget.h"
0009 #include <Gravatar/GravatarConfigureSettingsWidget>
0010 #include <QCheckBox>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 
0014 QTEST_MAIN(GravatarConfigureSettingsPluginWidgetTest)
0015 
0016 GravatarConfigureSettingsPluginWidgetTest::GravatarConfigureSettingsPluginWidgetTest(QObject *parent)
0017     : QObject(parent)
0018 {
0019 }
0020 
0021 void GravatarConfigureSettingsPluginWidgetTest::shouldHaveDefaultValue()
0022 {
0023     GravatarConfigureSettingsPluginWidget w;
0024 
0025     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
0026     QVERIFY(mainLayout);
0027     QCOMPARE(mainLayout->contentsMargins(), QMargins());
0028 
0029     auto mEnableGravatarSupport = w.findChild<QCheckBox *>(QStringLiteral("gravatarcheckbox"));
0030     QVERIFY(mEnableGravatarSupport);
0031     QVERIFY(!mEnableGravatarSupport->isChecked());
0032     QVERIFY(!mEnableGravatarSupport->text().isEmpty());
0033 
0034     auto mGravatarConfigWidget = w.findChild<Gravatar::GravatarConfigureSettingsWidget *>(QStringLiteral("gravatarconfigwidget"));
0035     QVERIFY(mGravatarConfigWidget);
0036 }
0037 
0038 #include "moc_gravatarconfiguresettingspluginwidgettest.cpp"