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

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "administratorwidgettest.h"
0008 #include "administratordialog/administratorwidget.h"
0009 #include "administratordialog/customemoji/administratorcustomemojiwidget.h"
0010 #include "administratordialog/customsounds/administratorcustomsoundswidget.h"
0011 #include "administratordialog/customuserstatus/administratorcustomuserstatuswidget.h"
0012 #include "administratordialog/invites/administratorinviteswidget.h"
0013 #include "administratordialog/logs/viewlogwidget.h"
0014 #include "administratordialog/moderationconsole/administratormoderationconsolewidget.h"
0015 #include "administratordialog/oauth/administratoroauthwidget.h"
0016 #include "administratordialog/permissions/permissionswidget.h"
0017 #include "administratordialog/roles/administratorroleswidget.h"
0018 #include "administratordialog/rooms/administratorroomswidget.h"
0019 #include "administratordialog/serverinfo/administratorserverinfowidget.h"
0020 #include "administratordialog/users/administratoruserswidget.h"
0021 
0022 #include <QTabWidget>
0023 #include <QTest>
0024 #include <QVBoxLayout>
0025 
0026 QTEST_MAIN(AdministratorWidgetTest)
0027 AdministratorWidgetTest::AdministratorWidgetTest(QObject *parent)
0028     : QObject(parent)
0029 {
0030 }
0031 
0032 void AdministratorWidgetTest::shouldHaveDefaultValues()
0033 {
0034     AdministratorWidget w(nullptr);
0035 
0036     auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0037     QVERIFY(mainLayout);
0038     QCOMPARE(mainLayout->contentsMargins(), QMargins{});
0039 
0040     auto mTabWidget = w.findChild<QTabWidget *>(QStringLiteral("mTabWidget"));
0041     QVERIFY(mTabWidget);
0042 
0043     auto mAdministratorRoomsWidget = w.findChild<AdministratorRoomsWidget *>(QStringLiteral("mAdministratorRoomsWidget"));
0044     QVERIFY(mAdministratorRoomsWidget);
0045 
0046     auto mAdministratorCustomUserStatusWidget = w.findChild<AdministratorCustomUserStatusWidget *>(QStringLiteral("mAdministratorCustomUserStatusWidget"));
0047     QVERIFY(mAdministratorCustomUserStatusWidget);
0048 
0049     auto mAdministratorCustomSoundsWidget = w.findChild<AdministratorCustomSoundsWidget *>(QStringLiteral("mAdministratorCustomSoundsWidget"));
0050     QVERIFY(mAdministratorCustomSoundsWidget);
0051 
0052     auto mAdministratorServerInfoWidget = w.findChild<AdministratorServerInfoWidget *>(QStringLiteral("mAdministratorServerInfoWidget"));
0053     QVERIFY(mAdministratorServerInfoWidget);
0054 
0055     auto mAdministratorUsersWidget = w.findChild<AdministratorUsersWidget *>(QStringLiteral("mAdministratorUsersWidget"));
0056     QVERIFY(mAdministratorUsersWidget);
0057 
0058     auto mAdministratorInvitesWidget = w.findChild<AdministratorInvitesWidget *>(QStringLiteral("mAdministratorInvitesWidget"));
0059     QVERIFY(mAdministratorInvitesWidget);
0060 
0061     auto mViewLogWidget = w.findChild<ViewLogWidget *>(QStringLiteral("mViewLogWidget"));
0062     QVERIFY(mViewLogWidget);
0063 
0064     auto mAdministratorCustomEmojiWidget = w.findChild<AdministratorCustomEmojiWidget *>(QStringLiteral("mAdministratorCustomEmojiWidget"));
0065     QVERIFY(mAdministratorCustomEmojiWidget);
0066 
0067     auto mPermissionsWidget = w.findChild<PermissionsWidget *>(QStringLiteral("mPermissionsWidget"));
0068     QVERIFY(mPermissionsWidget);
0069 
0070     auto mRolesWidget = w.findChild<AdministratorRolesWidget *>(QStringLiteral("mRolesWidget"));
0071     QVERIFY(mRolesWidget);
0072 
0073     auto mOauthWidget = w.findChild<AdministratorOauthWidget *>(QStringLiteral("mOauthWidget"));
0074     QVERIFY(mOauthWidget);
0075 
0076     auto mAdministratorModerationConsoleWidget = w.findChild<AdministratorModerationConsoleWidget *>(QStringLiteral("mAdministratorModerationConsoleWidget"));
0077     QVERIFY(mAdministratorModerationConsoleWidget);
0078 }
0079 
0080 #include "moc_administratorwidgettest.cpp"