File indexing completed on 2024-06-09 04:59:04

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 "createnewchannelwidgettest.h"
0008 #include "dialogs/channelnamevalidlinewidget.h"
0009 #include "dialogs/createnewchannelwidget.h"
0010 #include "misc/adduserswidget.h"
0011 #include <QCheckBox>
0012 #include <QLineEdit>
0013 #include <QTest>
0014 QTEST_MAIN(CreateNewChannelWidgetTest)
0015 CreateNewChannelWidgetTest::CreateNewChannelWidgetTest(QObject *parent)
0016     : QObject(parent)
0017 {
0018 }
0019 
0020 void CreateNewChannelWidgetTest::shouldHaveDefaultValues()
0021 {
0022     CreateNewChannelWidget w(nullptr);
0023     auto mChannelName = w.findChild<ChannelNameValidLineWidget *>(QStringLiteral("mChannelName"));
0024     QVERIFY(mChannelName);
0025 
0026     auto mTopicLineEdit = w.findChild<QLineEdit *>(QStringLiteral("mTopicLineEdit"));
0027     QVERIFY(mTopicLineEdit);
0028 
0029     auto mUsers = w.findChild<AddUsersWidget *>(QStringLiteral("mUsers"));
0030     QVERIFY(mUsers);
0031 
0032     auto mReadOnly = w.findChild<QCheckBox *>(QStringLiteral("mReadOnly"));
0033     QVERIFY(mReadOnly);
0034     auto mBroadcast = w.findChild<QCheckBox *>(QStringLiteral("mBroadcast"));
0035     QVERIFY(mBroadcast);
0036     auto mPrivate = w.findChild<QCheckBox *>(QStringLiteral("mPrivate"));
0037     QVERIFY(mPrivate);
0038     auto mEncryptedRoom = w.findChild<QCheckBox *>(QStringLiteral("mEncryptedRoom"));
0039     QVERIFY(mEncryptedRoom);
0040 }
0041 
0042 #include "moc_createnewchannelwidgettest.cpp"