File indexing completed on 2024-12-22 04:45:34

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "administratormoderationrangewidgettest.h"
0008 #include "administratordialog/moderationconsole/administratormoderationrangewidget.h"
0009 #include <QDateEdit>
0010 #include <QHBoxLayout>
0011 #include <QLabel>
0012 #include <QTest>
0013 #include <QToolButton>
0014 QTEST_MAIN(AdministratorModerationRangeWidgetTest)
0015 AdministratorModerationRangeWidgetTest::AdministratorModerationRangeWidgetTest(QObject *parent)
0016     : QObject{parent}
0017 {
0018 }
0019 
0020 void AdministratorModerationRangeWidgetTest::shouldHaveDefaultValues()
0021 {
0022     AdministratorModerationRangeWidget w;
0023 
0024     auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
0025     QVERIFY(mainLayout);
0026 
0027     auto fromLabel = w.findChild<QLabel *>(QStringLiteral("fromLabel"));
0028     QVERIFY(fromLabel);
0029     QVERIFY(!fromLabel->text().isEmpty());
0030 
0031     auto toLabel = w.findChild<QLabel *>(QStringLiteral("toLabel"));
0032     QVERIFY(toLabel);
0033     QVERIFY(!toLabel->text().isEmpty());
0034 
0035     auto mFromDate = w.findChild<QDateEdit *>(QStringLiteral("mFromDate"));
0036     QVERIFY(mFromDate);
0037     auto mToDate = w.findChild<QDateEdit *>(QStringLiteral("mToDate"));
0038     QVERIFY(mToDate);
0039 
0040     auto mFilterDate = w.findChild<QToolButton *>(QStringLiteral("mFilterDate"));
0041     QVERIFY(mFilterDate);
0042     QVERIFY(mFilterDate->autoRaise());
0043 }
0044 
0045 #include "moc_administratormoderationrangewidgettest.cpp"