@@ -25,7 +25,7 @@ use ruma::{
25
25
use stream_assert:: assert_next_matches;
26
26
27
27
use super :: TestTimeline ;
28
- use crate :: timeline:: { traits:: RoomDataProvider as _, TimelineItemKind , VirtualTimelineItem } ;
28
+ use crate :: timeline:: { traits:: RoomDataProvider as _, VirtualTimelineItem } ;
29
29
30
30
#[ async_test]
31
31
async fn test_day_divider ( ) {
@@ -84,7 +84,7 @@ async fn test_day_divider() {
84
84
// The other events are in the past so a local event always creates a new day
85
85
// divider.
86
86
let day_divider = assert_next_matches ! ( stream, VectorDiff :: Insert { index: 5 , value } => value) ;
87
- assert_matches ! ( day_divider. as_virtual ( ) . unwrap ( ) , VirtualTimelineItem :: DayDivider { .. } ) ;
87
+ assert ! ( day_divider. is_day_divider ( ) ) ;
88
88
}
89
89
90
90
#[ async_test]
@@ -127,7 +127,7 @@ async fn test_update_read_marker() {
127
127
128
128
// Now the read marker is reinserted after the second event.
129
129
let marker = assert_next_matches ! ( stream, VectorDiff :: Insert { index: 3 , value } => value) ;
130
- assert_matches ! ( marker. kind , TimelineItemKind :: Virtual ( VirtualTimelineItem :: ReadMarker ) ) ;
130
+ assert ! ( marker. is_read_marker ( ) ) ;
131
131
132
132
// Nothing should happen if the fully read event is set back to an older event
133
133
// sent by another user.
@@ -152,7 +152,7 @@ async fn test_update_read_marker() {
152
152
// The read marker is moved after the third event (sent by another user).
153
153
assert_next_matches ! ( stream, VectorDiff :: Remove { index: 3 } ) ;
154
154
let marker = assert_next_matches ! ( stream, VectorDiff :: Insert { index: 4 , value } => value) ;
155
- assert_matches ! ( marker. kind , TimelineItemKind :: Virtual ( VirtualTimelineItem :: ReadMarker ) ) ;
155
+ assert ! ( marker. is_read_marker ( ) ) ;
156
156
157
157
// If the current user sends an event afterwards, the read marker doesn't move.
158
158
timeline. handle_live_event ( f. text_msg ( "E" ) . sender ( & own_user) ) . await ;
@@ -186,5 +186,5 @@ async fn test_update_read_marker() {
186
186
item. as_event ( ) . unwrap ( ) ;
187
187
188
188
let marker = assert_next_matches ! ( stream, VectorDiff :: Insert { index: 8 , value } => value) ;
189
- assert_matches ! ( marker. kind , TimelineItemKind :: Virtual ( VirtualTimelineItem :: ReadMarker ) ) ;
189
+ assert ! ( marker. is_read_marker ( ) ) ;
190
190
}
0 commit comments