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

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "directorynotauthorizedwidgettest.h"
0008 #include "directory/directorynotauthorizedwidget.h"
0009 #include <QHBoxLayout>
0010 #include <QLabel>
0011 #include <QTest>
0012 QTEST_MAIN(DirectoryNotAuthorizedWidgetTest)
0013 DirectoryNotAuthorizedWidgetTest::DirectoryNotAuthorizedWidgetTest(QObject *parent)
0014     : QObject{parent}
0015 {
0016 }
0017 
0018 void DirectoryNotAuthorizedWidgetTest::shouldHaveDefaultValues()
0019 {
0020     DirectoryNotAuthorizedWidget w(nullptr);
0021 
0022     auto mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainLayout"));
0023     QVERIFY(mainLayout);
0024     QCOMPARE(mainLayout->contentsMargins(), QMargins());
0025 
0026     auto label = w.findChild<QLabel *>(QStringLiteral("label"));
0027     QVERIFY(label);
0028     QVERIFY(!label->text().isEmpty());
0029     QCOMPARE(label->textFormat(), Qt::RichText);
0030 }
0031 
0032 #include "moc_directorynotauthorizedwidgettest.cpp"