File indexing completed on 2025-01-19 04:46:43

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "confirmaddressconfigurewidgettest.h"
0008 #include "../confirmaddressconfiguretab.h"
0009 #include "../confirmaddressconfigurewidget.h"
0010 
0011 #include <QCheckBox>
0012 #include <QStandardPaths>
0013 #include <QTest>
0014 #include <QVBoxLayout>
0015 
0016 ConfirmAddressConfigureWidgetTest::ConfirmAddressConfigureWidgetTest(QObject *parent)
0017     : QObject(parent)
0018 {
0019     QStandardPaths::setTestModeEnabled(true);
0020 }
0021 
0022 ConfirmAddressConfigureWidgetTest::~ConfirmAddressConfigureWidgetTest() = default;
0023 
0024 void ConfirmAddressConfigureWidgetTest::shouldHaveDefaultValue()
0025 {
0026     ConfirmAddressConfigureWidget w;
0027 
0028     auto vboxlayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
0029     QVERIFY(vboxlayout);
0030 
0031     auto mConfirmAddressConfigureTab = w.findChild<ConfirmAddressConfigureTab *>(QStringLiteral("confirmaddresstab"));
0032     QVERIFY(mConfirmAddressConfigureTab);
0033 }
0034 
0035 void ConfirmAddressConfigureWidgetTest::shouldLoadSaveResetValue()
0036 {
0037     ConfirmAddressConfigureWidget w;
0038     w.loadSettings();
0039     w.saveSettings();
0040     w.resetSettings();
0041 }
0042 
0043 QTEST_MAIN(ConfirmAddressConfigureWidgetTest)
0044 
0045 #include "moc_confirmaddressconfigurewidgettest.cpp"