File indexing completed on 2024-12-01 04:35:26
0001 /* 0002 SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "rocketchataccounttest.h" 0008 #include "model/commonmessagefilterproxymodel.h" 0009 #include "model/commonmessagesmodel.h" 0010 #include "model/discussionsfilterproxymodel.h" 0011 #include "model/discussionsmodel.h" 0012 #include "model/filesforroomfilterproxymodel.h" 0013 #include "model/filesforroommodel.h" 0014 #include "model/listmessagesfilterproxymodel.h" 0015 #include "rocketchataccount.h" 0016 #include <QStandardPaths> 0017 #include <QTest> 0018 0019 QTEST_GUILESS_MAIN(RocketChatAccountTest) 0020 0021 RocketChatAccountTest::RocketChatAccountTest(QObject *parent) 0022 : QObject(parent) 0023 { 0024 QStandardPaths::setTestModeEnabled(true); 0025 } 0026 0027 void RocketChatAccountTest::shouldHaveDefaultValue() 0028 { 0029 RocketChatAccount w; 0030 QVERIFY(w.emojiManager()); 0031 QVERIFY(w.roomModel()); 0032 QVERIFY(w.settings()); 0033 QVERIFY(!w.ruqolaLogger()); 0034 QVERIFY(w.ruqolaServerConfig()); 0035 QVERIFY(w.userCompleterFilterProxyModel()); 0036 QVERIFY(w.inputTextManager()); 0037 QVERIFY(w.inputThreadMessageTextManager()); 0038 QVERIFY(w.searchMessageModel()); 0039 QCOMPARE(w.searchMessageFilterProxyModel()->sourceModel(), w.searchMessageModel()); 0040 QVERIFY(w.receiveTypingNotificationManager()); 0041 QVERIFY(!w.editingMode()); 0042 QVERIFY(w.filesModelForRoom()); 0043 QVERIFY(w.filesForRoomFilterProxyModel()); 0044 QCOMPARE(w.filesForRoomFilterProxyModel()->sourceModel(), w.filesModelForRoom()); 0045 QVERIFY(w.discussionsFilterProxyModel()); 0046 QCOMPARE(w.discussionsFilterProxyModel()->sourceModel(), w.discussionsModel()); 0047 0048 QVERIFY(w.listMessageModel()); 0049 QCOMPARE(w.listMessagesFilterProxyModel()->sourceModel(), w.listMessageModel()); 0050 0051 QVERIFY(w.autoTranslateLanguagesModel()); 0052 QVERIFY(w.accountRoomSettings()); 0053 QVERIFY(w.commandsModel()); 0054 QVERIFY(!w.allowAvatarChanged()); 0055 QVERIFY(w.customSoundManager()); 0056 0057 QVERIFY(!w.twoFactorAuthenticationEnabled()); 0058 QVERIFY(!w.twoFactorAuthenticationByEmailEnabled()); 0059 QVERIFY(!w.twoFactorAuthenticationByTOTPEnabled()); 0060 0061 QVERIFY(!w.twoFactorAuthenticationEnforcePasswordFallback()); 0062 0063 QVERIFY(w.searchListCompletion().isEmpty()); 0064 QVERIFY(w.uploadFileManager()); 0065 QVERIFY(!w.allowPasswordReset()); 0066 QVERIFY(w.bannerInfos().isEmpty()); 0067 QVERIFY(w.videoConferenceManager()); 0068 QVERIFY(w.videoConferenceMessageInfoManager()); 0069 } 0070 0071 #include "moc_rocketchataccounttest.cpp"