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

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "remotecontentdialogtest.h"
0008 #include "remote-content/remotecontentdialog.h"
0009 #include "remote-content/remotecontentwidget.h"
0010 #include <QDialogButtonBox>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 QTEST_MAIN(RemoteContentDialogTest)
0014 
0015 RemoteContentDialogTest::RemoteContentDialogTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void RemoteContentDialogTest::shouldHaveDefaultValues()
0021 {
0022     MessageViewer::RemoteContentDialog w;
0023 
0024     QVERIFY(w.windowTitle().isEmpty());
0025 
0026     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0027     QVERIFY(mainLayout);
0028 
0029     auto mRemoveContentWidget = w.findChild<MessageViewer::RemoteContentWidget *>(QStringLiteral("mRemoveContentWidget"));
0030     QVERIFY(mRemoveContentWidget);
0031 
0032     auto buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
0033     QVERIFY(buttonBox);
0034     QCOMPARE(buttonBox->standardButtons(), QDialogButtonBox::StandardButtons{QDialogButtonBox::Ok | QDialogButtonBox::Cancel});
0035 }
0036 
0037 #include "moc_remotecontentdialogtest.cpp"