@@ -261,10 +261,18 @@ async fn back_pagination() {
261261
262262 timeline. paginate_backwards ( uint ! ( 10 ) ) . await . unwrap ( ) ;
263263
264- let _day_divider = assert_matches ! (
264+ let loading = assert_matches ! (
265265 timeline_stream. next( ) . await ,
266266 Some ( VecDiff :: Push { value } ) => value
267267 ) ;
268+ assert_matches ! ( loading. as_virtual( ) . unwrap( ) , VirtualTimelineItem :: LoadingIndicator ) ;
269+
270+ let day_divider = assert_matches ! (
271+ timeline_stream. next( ) . await ,
272+ Some ( VecDiff :: Push { value } ) => value
273+ ) ;
274+ assert_matches ! ( day_divider. as_virtual( ) . unwrap( ) , VirtualTimelineItem :: DayDivider { .. } ) ;
275+
268276 let message = assert_matches ! (
269277 timeline_stream. next( ) . await ,
270278 Some ( VecDiff :: Push { value } ) => value
@@ -278,14 +286,17 @@ async fn back_pagination() {
278286
279287 let message = assert_matches ! (
280288 timeline_stream. next( ) . await ,
281- Some ( VecDiff :: InsertAt { index: 1 , value } ) => value
289+ Some ( VecDiff :: InsertAt { index: 2 , value } ) => value
282290 ) ;
283291 let msg = assert_matches ! (
284292 message. as_event( ) . unwrap( ) . content( ) ,
285293 TimelineItemContent :: Message ( msg) => msg
286294 ) ;
287295 let text = assert_matches ! ( msg. msgtype( ) , MessageType :: Text ( text) => text) ;
288296 assert_eq ! ( text. body, "the world is big" ) ;
297+
298+ // Removal of the loading indicator
299+ assert_matches ! ( timeline_stream. next( ) . await , Some ( VecDiff :: RemoveAt { index: 0 } ) ) ;
289300}
290301
291302#[ async_test]
0 commit comments