test(sdk): Add read marker case when fully read event wasn't found
@@ -258,6 +258,16 @@ async fn update_read_marker() {
timeline.inner.set_fully_read_event(event_id).await;
assert_matches!(stream.next().await, Some(VecDiff::Move { old_index: 1, new_index: 2 }));
+
+ // Nothing should happen if the fully read event isn't found.
+ timeline.inner.set_fully_read_event(event_id!("$fake_event_id").to_owned()).await;
+
+ timeline.handle_live_message_event(&ALICE, RoomMessageEventContent::text_plain("C")).await;
+ let item = assert_matches!(stream.next().await, Some(VecDiff::Push { value }) => value);
+ let event_id = item.as_event().unwrap().event_id().unwrap().to_owned();
+
+ timeline.inner.set_fully_read_event(event_id).await;
+ assert_matches!(stream.next().await, Some(VecDiff::Move { old_index: 2, new_index: 3 }));
}
#[async_test]
