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 "directorystackedwidgettest.h" 0008 #include "directory/directorynotauthorizedwidget.h" 0009 #include "directory/directorystackedwidget.h" 0010 #include "directory/directorywidget.h" 0011 #include <QTest> 0012 QTEST_MAIN(DirectoryStackedWidgetTest) 0013 0014 DirectoryStackedWidgetTest::DirectoryStackedWidgetTest(QObject *parent) 0015 : QObject{parent} 0016 { 0017 } 0018 0019 void DirectoryStackedWidgetTest::shouldHaveDefaultValues() 0020 { 0021 DirectoryStackedWidget w(nullptr, DirectoryWidget::Unknown); 0022 0023 auto mDirectoryWidget = w.findChild<DirectoryWidget *>(QStringLiteral("mDirectoryWidget")); 0024 QVERIFY(mDirectoryWidget); 0025 0026 auto mDirectoryNotAutorizedWidget = w.findChild<DirectoryNotAuthorizedWidget *>(QStringLiteral("mDirectoryNotAutorizedWidget")); 0027 QVERIFY(mDirectoryNotAutorizedWidget); 0028 0029 QCOMPARE(w.currentWidget(), mDirectoryWidget); 0030 0031 QVERIFY(w.isAutorized()); 0032 0033 QVERIFY(w.directoryWidget()); 0034 0035 QVERIFY(w.directoryNotAutorizedWidget()); 0036 } 0037 0038 #include "moc_directorystackedwidgettest.cpp"