Changeset View
Changeset View
Standalone View
Standalone View
src/tests/client/storage-actions-test.cpp
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | auto [next, _] = updateClient(c, LoadEventsFromStorageAction{ | ||||
| REQUIRE(room.timeline == intoImmer(immer::flex_vector<std::string>{}, zug::map(&Event::id), existingEvents + timelineEvents)); | REQUIRE(room.timeline == intoImmer(immer::flex_vector<std::string>{}, zug::map(&Event::id), existingEvents + timelineEvents)); | ||||
| REQUIRE_THAT(existingEvents + timelineEvents + relatedEvents, | REQUIRE_THAT(existingEvents + timelineEvents + relatedEvents, | ||||
| AllMatch(Predicate<Event>([&room](const auto &e) { return !!room.messages.count(e.id()); }, "should be in messages"))); | AllMatch(Predicate<Event>([&room](const auto &e) { return !!room.messages.count(e.id()); }, "should be in messages"))); | ||||
| REQUIRE(room.reverseEventRelationships.count(timelineEvents[0].id())); | REQUIRE(room.reverseEventRelationships.count(timelineEvents[0].id())); | ||||
| REQUIRE(room.reverseEventRelationships.count(existingEvents[0].id())); | REQUIRE(room.reverseEventRelationships.count(existingEvents[0].id())); | ||||
| // should not give out any SaveEventsRequested triggers | // should not give out any SaveEventsRequested triggers | ||||
| REQUIRE_THAT(next.nextTriggers, NoneMatch(Predicate<KazvEvent>([](const auto &t) { | REQUIRE_THAT(next.nextTriggers, NoneMatch(Predicate<KazvTrigger>([](const auto &t) { | ||||
| return std::holds_alternative<SaveEventsRequested>(t); | return std::holds_alternative<SaveEventsRequested>(t); | ||||
| }))); | }))); | ||||
| } | } | ||||
| // Verify the load works when loading into timeline an event in | // Verify the load works when loading into timeline an event in | ||||
| // messages but not in timeline | // messages but not in timeline | ||||
| auto nextTimelineEvents = relatedEvents + EventList{makeEventInRoom()}; | auto nextTimelineEvents = relatedEvents + EventList{makeEventInRoom()}; | ||||
| std::tie(next, std::ignore) = updateClient(next, LoadEventsFromStorageAction{ | std::tie(next, std::ignore) = updateClient(next, LoadEventsFromStorageAction{ | ||||
| {{roomId, nextTimelineEvents}}, | {{roomId, nextTimelineEvents}}, | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||