File indexing completed on 2025-03-09 04:54:37

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 "remotecontentconfiguredialogtest.h"
0008 #include "remote-content/remotecontentconfiguredialog.h"
0009 #include "remote-content/remotecontentconfigurewidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QStandardPaths>
0012 #include <QTest>
0013 #include <QVBoxLayout>
0014 QTEST_MAIN(RemoteContentConfigureDialogTest)
0015 RemoteContentConfigureDialogTest::RemoteContentConfigureDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018     QStandardPaths::setTestModeEnabled(true);
0019 }
0020 
0021 void RemoteContentConfigureDialogTest::shouldHaveDefaultValues()
0022 {
0023     MessageViewer::RemoteContentConfigureDialog w;
0024 
0025     QVERIFY(!w.windowTitle().isEmpty());
0026 
0027     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0028     QVERIFY(mainLayout);
0029 
0030     auto mRemoteContentConfigureWidget = w.findChild<MessageViewer::RemoteContentConfigureWidget *>(QStringLiteral("mRemoteContentConfigureWidget"));
0031     QVERIFY(mRemoteContentConfigureWidget);
0032 
0033     auto buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
0034     QVERIFY(buttonBox);
0035     QCOMPARE(buttonBox->standardButtons(), QDialogButtonBox::StandardButtons{QDialogButtonBox::Close});
0036 }
0037 
0038 #include "moc_remotecontentconfiguredialogtest.cpp"