File indexing completed on 2024-04-21 04:59:11
0001 // SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu> 0002 // SPDX-License-Identifier: GPL-3.0-or-later 0003 0004 #include <QObject> 0005 #include <QSignalSpy> 0006 #include <QTest> 0007 0008 #include <Quotient/connection.h> 0009 #include <Quotient/quotient_common.h> 0010 #include <Quotient/syncdata.h> 0011 0012 #include "testutils.h" 0013 0014 using namespace Quotient; 0015 0016 class NeoChatRoomTest : public QObject { 0017 Q_OBJECT 0018 0019 private: 0020 Connection *connection = nullptr; 0021 TestUtils::TestRoom *room = nullptr; 0022 0023 private Q_SLOTS: 0024 void initTestCase(); 0025 void eventTest(); 0026 }; 0027 0028 void NeoChatRoomTest::initTestCase() 0029 { 0030 connection = Connection::makeMockConnection(QStringLiteral("@bob:kde.org")); 0031 room = new TestUtils::TestRoom(connection, QStringLiteral("#myroom:kde.org"), "test-min-sync.json"_ls); 0032 } 0033 0034 void NeoChatRoomTest::eventTest() 0035 { 0036 QCOMPARE(room->timelineSize(), 1); 0037 } 0038 0039 QTEST_GUILESS_MAIN(NeoChatRoomTest) 0040 #include "neochatroomtest.moc"