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

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 "administratorinviteswidgettest.h"
0008 #include "administratordialog/invites/administratorinviteswidget.h"
0009 #include "administratordialog/invites/invitetreeview.h"
0010 #include <QLineEdit>
0011 #include <QTest>
0012 #include <QVBoxLayout>
0013 QTEST_MAIN(AdministratorInvitesWidgetTest)
0014 AdministratorInvitesWidgetTest::AdministratorInvitesWidgetTest(QObject *parent)
0015     : QObject(parent)
0016 {
0017 }
0018 
0019 void AdministratorInvitesWidgetTest::shouldHaveDefaultValues()
0020 {
0021     AdministratorInvitesWidget d(nullptr);
0022     auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
0023     QVERIFY(mainLayout);
0024     auto mSearchLineWidget = d.findChild<QLineEdit *>(QStringLiteral("mSearchLineWidget"));
0025     QVERIFY(mSearchLineWidget);
0026     QVERIFY(mSearchLineWidget->text().isEmpty());
0027     QVERIFY(!mSearchLineWidget->placeholderText().isEmpty());
0028 
0029     auto mInviteTreeView = d.findChild<InviteTreeView *>(QStringLiteral("mInviteTreeWidget"));
0030     QVERIFY(mInviteTreeView);
0031 }
0032 
0033 #include "moc_administratorinviteswidgettest.cpp"