File indexing completed on 2024-11-24 04:43:06

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 "confirmbeforedeletingmessageboxwidgettest.h"
0008 #include "confirmbeforedeletingmessageboxwidget.h"
0009 #include <QCheckBox>
0010 #include <QLabel>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 QTEST_MAIN(ConfirmBeforeDeletingMessageBoxWidgetTest)
0014 ConfirmBeforeDeletingMessageBoxWidgetTest::ConfirmBeforeDeletingMessageBoxWidgetTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 void ConfirmBeforeDeletingMessageBoxWidgetTest::shouldHaveDefaultValues()
0020 {
0021     ConfirmBeforeDeletingMessageBoxWidget w;
0022     auto mUseSameResultForOtherCheck = w.findChild<QCheckBox *>(QStringLiteral("mUseSameResultForOtherCheck"));
0023     QVERIFY(mUseSameResultForOtherCheck);
0024     QVERIFY(!mUseSameResultForOtherCheck->text().isEmpty());
0025     QVERIFY(!mUseSameResultForOtherCheck->isChecked());
0026 
0027     auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
0028     QVERIFY(mainLayout);
0029     QCOMPARE(mainLayout->contentsMargins(), QMargins{});
0030 
0031     auto textLayout = w.findChild<QVBoxLayout *>(QStringLiteral("textLayout"));
0032     QVERIFY(textLayout);
0033     QCOMPARE(textLayout->contentsMargins(), QMargins{});
0034 
0035     auto iconLabel = w.findChild<QLabel *>(QStringLiteral("iconLabel"));
0036     QVERIFY(iconLabel);
0037     QVERIFY(iconLabel->text().isEmpty());
0038 
0039     auto mLabelInfo = w.findChild<QLabel *>(QStringLiteral("mLabelInfo"));
0040     QVERIFY(mLabelInfo);
0041     QVERIFY(mLabelInfo->text().isEmpty());
0042     QVERIFY(mLabelInfo->wordWrap());
0043 }
0044 
0045 #include "moc_confirmbeforedeletingmessageboxwidgettest.cpp"