diff options
Diffstat (limited to 'tests/quotest.cpp')
-rw-r--r-- | tests/quotest.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/quotest.cpp b/tests/quotest.cpp index 68b8ebd6..7076264c 100644 --- a/tests/quotest.cpp +++ b/tests/quotest.cpp @@ -217,22 +217,20 @@ void TestManager::setupAndRun() clog << "Access token: " << c->accessToken().toStdString() << endl; c->setLazyLoading(true); - c->syncLoop(); clog << "Joining " << targetRoomName.toStdString() << endl; auto joinJob = c->joinRoom(targetRoomName); - // Ensure, before this test is completed, that the room has been joined - // and filled with some events so that other tests could use that + // Ensure that the room has been joined and filled with some events + // so that other tests could use that connect(joinJob, &BaseJob::success, this, [this, joinJob] { testSuite = new TestSuite(c->room(joinJob->roomId()), origin, this); + // Only start the sync after joining, to make sure the room just + // joined is in it + c->syncLoop(); connectSingleShot(c, &Connection::syncDone, this, [this] { - if (testSuite->room()->timelineSize() > 0) - doTests(); - else { - testSuite->room()->getPreviousContent(); - connectSingleShot(testSuite->room(), &Room::addedMessages, this, - &TestManager::doTests); - } + testSuite->room()->getPreviousContent(); + connectSingleShot(testSuite->room(), &Room::addedMessages, this, + &TestManager::doTests); }); }); connect(joinJob, &BaseJob::failure, this, [this] { |