From ead4061faa04b2a8cd27c920a86f809620013add Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 20 Jun 2024 21:05:22 +0200 Subject: [PATCH] test(ui): Update `room_list_service` integration tests. This patch updates the `room_list_service` integration test suite based on the previous commit that changes `RoomListEntry` by `Room`. --- .../src/room_list_service/filters/mod.rs | 3 +- .../src/room_list_service/mod.rs | 1 - .../src/room_list_service/room_list.rs | 8 +- .../tests/integration/room_list_service.rs | 399 ++++-------------- 4 files changed, 96 insertions(+), 315 deletions(-) diff --git a/crates/matrix-sdk-ui/src/room_list_service/filters/mod.rs b/crates/matrix-sdk-ui/src/room_list_service/filters/mod.rs index befc3c9ac3e..d06ed1c5fa1 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/filters/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/filters/mod.rs @@ -96,8 +96,7 @@ use super::Room; /// A trait “alias” that represents a _filter_. /// -/// A filter is simply a function that receives a `&RoomListEntry` and returns a -/// `bool`. +/// A filter is simply a function that receives a `&Room` and returns a `bool`. pub trait Filter: Fn(&Room) -> bool {} impl Filter for F where F: Fn(&Room) -> bool {} diff --git a/crates/matrix-sdk-ui/src/room_list_service/mod.rs b/crates/matrix-sdk-ui/src/room_list_service/mod.rs index bc0b6bce39a..e68b5da7e18 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/mod.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/mod.rs @@ -76,7 +76,6 @@ use std::{ use async_stream::stream; use eyeball::{SharedObservable, Subscriber}; use futures_util::{pin_mut, Stream, StreamExt}; -pub use matrix_sdk::RoomListEntry; use matrix_sdk::{ event_cache::EventCacheError, sliding_sync::Ranges, Client, Error as SlidingSyncError, SlidingSync, SlidingSyncList, SlidingSyncListBuilder, SlidingSyncMode, diff --git a/crates/matrix-sdk-ui/src/room_list_service/room_list.rs b/crates/matrix-sdk-ui/src/room_list_service/room_list.rs index 41eff1d790f..606fc583c6e 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/room_list.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/room_list.rs @@ -300,10 +300,10 @@ pub enum RoomListLoadingState { /// The maximum number of rooms a [`RoomList`] contains. /// /// It does not mean that there are exactly this many rooms to display. - /// Usually, the room entries are represented by - /// [`RoomListEntry`]. The room entry might have been synced or not - /// synced yet, but we know for sure (from the server), that there will - /// be this amount of rooms in the list at the end. + /// Usually, the room entries are represented by [`Room`]. The room + /// entry might have been synced or not synced yet, but we know for sure + /// (from the server), that there will be this amount of rooms in the + /// list at the end. /// /// Note that it's an `Option`, because it may be possible that the /// server did miss to send us this value. It's up to you, dear reader, diff --git a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs index 9174711f17c..ce4f3564698 100644 --- a/crates/matrix-sdk-ui/tests/integration/room_list_service.rs +++ b/crates/matrix-sdk-ui/tests/integration/room_list_service.rs @@ -6,14 +6,13 @@ use std::{ use assert_matches::assert_matches; use eyeball_im::VectorDiff; use futures_util::{pin_mut, FutureExt, StreamExt}; -use imbl::vector; use matrix_sdk::{test_utils::logged_in_client_with_server, Client}; use matrix_sdk_base::sync::UnreadNotificationsCount; use matrix_sdk_test::async_test; use matrix_sdk_ui::{ room_list_service::{ filters::{new_filter_fuzzy_match_room_name, new_filter_non_left, new_filter_none}, - Error, Input, InputResult, RoomListEntry, RoomListLoadingState, State, SyncIndicator, + Error, Input, InputResult, RoomListLoadingState, State, SyncIndicator, ALL_ROOMS_LIST_NAME as ALL_ROOMS, VISIBLE_ROOMS_LIST_NAME as VISIBLE_ROOMS, }, timeline::{TimelineItemKind, VirtualTimelineItem}, @@ -32,7 +31,6 @@ use wiremock::MockServer; use crate::timeline::sliding_sync::{assert_timeline_stream, timeline_event}; -/* async fn new_room_list_service() -> Result<(Client, MockServer, RoomListService), Error> { let (client, server) = logged_in_client_with_server().await; let room_list = RoomListService::new(client.clone()).await?; @@ -94,31 +92,9 @@ macro_rules! sync_then_assert_request_and_fake_response { }; } -macro_rules! entries { - ( @_ [ E $( , $( $rest:tt )* )? ] [ $( $accumulator:tt )* ] ) => { - entries!( @_ [ $( $( $rest )* )? ] [ $( $accumulator )* RoomListEntry::Empty, ] ) - }; - - ( @_ [ F( $room_id:literal ) $( , $( $rest:tt )* )? ] [ $( $accumulator:tt )* ] ) => { - entries!( @_ [ $( $( $rest )* )? ] [ $( $accumulator )* RoomListEntry::Filled(room_id!( $room_id ).to_owned()), ] ) - }; - - ( @_ [ I( $room_id:literal ) $( , $( $rest:tt )* )? ] [ $( $accumulator:tt )* ] ) => { - entries!( @_ [ $( $( $rest )* )? ] [ $( $accumulator )* RoomListEntry::Invalidated(room_id!( $room_id ).to_owned()), ] ) - }; - - ( @_ [] [ $( $accumulator:tt )* ] ) => { - vector![ $( $accumulator )* ] - }; - - ( $( $all:tt )* ) => { - entries!( @_ [ $( $all )* ] [] ) - }; -} - macro_rules! assert_entries_batch { - // `append [$entries]` - ( @_ [ $entries:ident ] [ append [ $( $entry:tt )* ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { + // `append [$room_id, …]` + ( @_ [ $entries:ident ] [ append [ $( $room_id:literal ),* $(,)? ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { assert_entries_batch!( @_ [ $entries ] @@ -128,15 +104,45 @@ macro_rules! assert_entries_batch { assert_matches!( $entries.next(), Some(&VectorDiff::Append { ref values }) => { - assert_eq!(values, &entries!( $( $entry )* )); + #[allow(unused)] + let mut values = values.iter(); + + $( + assert_eq!( + values + .next() + .expect("One more room is expected, but is not present") + .room_id() + .as_str(), + $room_id, + ); + )* + } + ); + ] + ) + }; + + // `push back [$room_id]` + ( @_ [ $entries:ident ] [ push back [ $room_id:literal ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { + assert_entries_batch!( + @_ + [ $entries ] + [ $( $rest )* ] + [ + $( $accumulator )* + assert_matches!( + $entries.next(), + Some(&VectorDiff::PushBack { ref value }) => { + assert_eq!(value.room_id().to_string(), $room_id); } ); ] ) }; - // `set [$nth] [$entry]` - ( @_ [ $entries:ident ] [ set [ $index:literal ] [ $( $entry:tt )+ ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { + // `set [$nth] [$room_id]` + ( @_ [ $entries:ident ] [ set [ $index:literal ] [ $room_id:literal ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { assert_entries_batch!( @_ [ $entries ] @@ -146,7 +152,7 @@ macro_rules! assert_entries_batch { assert_matches!( $entries.next(), Some(&VectorDiff::Set { index: $index, ref value }) => { - assert_eq!(value, &entries!( $( $entry )+ )[0]); + assert_eq!(value.room_id().to_string(), $room_id); } ); ] @@ -161,16 +167,16 @@ macro_rules! assert_entries_batch { [ $( $rest )* ] [ $( $accumulator )* - assert_eq!( + assert_matches!( $entries.next(), - Some(&VectorDiff::Remove { index: $index }), + Some(&VectorDiff::Remove { index: $index }) ); ] ) }; - // `insert [$nth] [$entry]` - ( @_ [ $entries:ident ] [ insert [ $index:literal ] [ $( $entry:tt )+ ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { + // `insert [$nth] [$room_id]` + ( @_ [ $entries:ident ] [ insert [ $index:literal ] [ $room_id:literal ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { assert_entries_batch!( @_ [ $entries ] @@ -180,7 +186,7 @@ macro_rules! assert_entries_batch { assert_matches!( $entries.next(), Some(&VectorDiff::Insert { index: $index, ref value }) => { - assert_eq!(value, &entries!( $( $entry )+ )[0]); + assert_eq!(value.room_id().to_string(), $room_id); } ); ] @@ -195,16 +201,16 @@ macro_rules! assert_entries_batch { [ $( $rest )* ] [ $( $accumulator )* - assert_eq!( + assert_matches!( $entries.next(), - Some(&VectorDiff::Truncate { length: $length }), + Some(&VectorDiff::Truncate { length: $length }) ); ] ) }; - // `reset [$entries]` - ( @_ [ $entries:ident ] [ reset [ $( $entry:tt )* ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { + // `reset [$room_id, …]` + ( @_ [ $entries:ident ] [ reset [ $( $room_id:literal ),* $(,)? ] ; $( $rest:tt )* ] [ $( $accumulator:tt )* ] ) => { assert_entries_batch!( @_ [ $entries ] @@ -214,7 +220,19 @@ macro_rules! assert_entries_batch { assert_matches!( $entries.next(), Some(&VectorDiff::Reset { ref values }) => { - assert_eq!(values, &entries!( $( $entry )* )); + #[allow(unused)] + let mut values = values.iter(); + + $( + assert_eq!( + values + .next() + .expect("One more room is expected, but is not present") + .room_id() + .as_str(), + $room_id, + ); + )* } ); ] @@ -229,7 +247,7 @@ macro_rules! assert_entries_batch { [ $( $rest )* ] [ $( $accumulator )* - assert_eq!($entries.next(), None); + assert!($entries.next().is_none()); ] ) }; @@ -245,8 +263,8 @@ macro_rules! assert_entries_batch { let entries = $stream .next() .now_or_never() - .expect("stream entry wasn't in the ready state") - .expect("stream was stopped"); + .expect("Stream entry wasn't in the ready state") + .expect("Stream was stopped"); let mut entries = entries.iter(); @@ -308,9 +326,6 @@ async fn test_sync_all_states() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 420, - "ops": [ - // let's ignore them for now - ], }, }, "rooms": { @@ -355,13 +370,9 @@ async fn test_sync_all_states() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 420, - "ops": [ - // let's ignore them for now - ], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": { @@ -389,13 +400,9 @@ async fn test_sync_all_states() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 420, - "ops": [ - // let's ignore them for now - ], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": { @@ -423,13 +430,9 @@ async fn test_sync_all_states() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 420, - "ops": [ - // let's ignore them for now - ], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": { @@ -457,13 +460,9 @@ async fn test_sync_all_states() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 420, - "ops": [ - // let's ignore them for now - ], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": { @@ -499,7 +498,6 @@ async fn test_sync_resumes_from_previous_state() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [] }, }, "rooms": {}, @@ -530,11 +528,9 @@ async fn test_sync_resumes_from_previous_state() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": {}, @@ -565,11 +561,9 @@ async fn test_sync_resumes_from_previous_state() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [], }, VISIBLE_ROOMS: { "count": 0, - "ops": [], }, }, "rooms": {}, @@ -1309,32 +1303,18 @@ async fn test_entries_stream() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [0, 2], - "room_ids": [ - "!r0:bar.org", - "!r1:bar.org", - "!r2:bar.org", - ], - }, - ], }, }, "rooms": { "!r0:bar.org": { - "name": "Room #0", "initial": true, "timeline": [], }, "!r1:bar.org": { - "name": "Room #1", "initial": true, "timeline": [], }, "!r2:bar.org": { - "name": "Room #2", "initial": true, "timeline": [], }, @@ -1345,10 +1325,9 @@ async fn test_entries_stream() -> Result<(), Error> { assert!(previous_entries.is_empty()); assert_entries_batch! { [entries_stream] - append [ E, E, E, E, E, E, E, E, E, E ]; - set[0] [ F("!r0:bar.org") ]; - set[1] [ F("!r1:bar.org") ]; - set[2] [ F("!r2:bar.org") ]; + push back [ "!r0:bar.org" ]; + push back [ "!r1:bar.org" ]; + push back [ "!r2:bar.org" ]; end; }; @@ -1370,21 +1349,6 @@ async fn test_entries_stream() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 9, - "ops": [ - { - "op": "DELETE", - "index": 1, - }, - { - "op": "DELETE", - "index": 0, - }, - { - "op": "INSERT", - "index": 0, - "room_id": "!r3:bar.org", - }, - ], }, VISIBLE_ROOMS: { "count": 0, @@ -1392,7 +1356,6 @@ async fn test_entries_stream() -> Result<(), Error> { }, "rooms": { "!r3:bar.org": { - "name": "Room #3", "initial": true, "timeline": [], }, @@ -1402,9 +1365,7 @@ async fn test_entries_stream() -> Result<(), Error> { assert_entries_batch! { [entries_stream] - remove[1]; - remove[0]; - insert[0] [ F("!r3:bar.org") ]; + push back [ "!r3:bar.org" ]; end; }; @@ -1439,20 +1400,10 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [0, 0], - "room_ids": [ - "!r0:bar.org", - ], - }, - ], }, }, "rooms": { "!r0:bar.org": { - "name": "This is ignored", "initial": true, "timeline": [], "required_state": [ @@ -1483,7 +1434,7 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { assert_entries_batch! { [dynamic_entries_stream] // Receive a `reset` because the filter has been reset/set for the first time. - reset [ F("!r0:bar.org") ]; + reset [ "!r0:bar.org" ]; end; }; assert_pending!(dynamic_entries_stream); @@ -1506,18 +1457,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [1, 4], - "room_ids": [ - "!r1:bar.org", - "!r2:bar.org", - "!r3:bar.org", - "!r4:bar.org", - ], - }, - ], }, VISIBLE_ROOMS: { "count": 0, @@ -1525,13 +1464,12 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { }, "rooms": { "!r1:bar.org": { - "name": "Yop yop", "initial": true, "timeline": [], "required_state": [ { "content": { - "name": "Matrix Foobar" + "name": "Matrix Foobaz" }, "sender": "@example:bar.org", "state_key": "", @@ -1542,7 +1480,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { ], }, "!r2:bar.org": { - "name": "Hello", "initial": true, "timeline": [], "required_state": [ @@ -1559,7 +1496,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { ], }, "!r3:bar.org": { - "name": "Helios live", "initial": true, "timeline": [], "required_state": [ @@ -1576,7 +1512,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { ], }, "!r4:bar.org": { - "name": "Matrix Baz", "initial": true, "timeline": [], "required_state": [ @@ -1599,8 +1534,8 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { // Assert the dynamic entries. assert_entries_batch! { [dynamic_entries_stream] - insert[1] [ F("!r1:bar.org") ]; - insert[2] [ F("!r4:bar.org") ]; + push back [ "!r1:bar.org" ]; + push back [ "!r4:bar.org" ]; end; }; assert_pending!(dynamic_entries_stream); @@ -1623,17 +1558,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [5, 7], - "room_ids": [ - "!r5:bar.org", - "!r6:bar.org", - "!r7:bar.org", - ], - }, - ], }, VISIBLE_ROOMS: { "count": 0, @@ -1641,7 +1565,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { }, "rooms": { "!r5:bar.org": { - "name": "Matrix Barracuda Room", "initial": true, "timeline": [], "required_state": [ @@ -1658,7 +1581,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { ], }, "!r6:bar.org": { - "name": "Matrix is real as hell", "initial": true, "timeline": [], "required_state": [ @@ -1675,7 +1597,6 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { ], }, "!r7:bar.org": { - "name": "Matrix Baraka", "initial": true, "timeline": [], "required_state": [ @@ -1698,8 +1619,8 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { // Assert the dynamic entries. assert_entries_batch! { [dynamic_entries_stream] - insert[3] [ F("!r5:bar.org") ]; - insert[4] [ F("!r7:bar.org") ]; + push back [ "!r5:bar.org" ]; + push back [ "!r7:bar.org" ]; end; }; assert_pending!(dynamic_entries_stream); @@ -1711,7 +1632,7 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { assert_entries_batch! { [dynamic_entries_stream] // Receive a `reset` again because the filter has been reset. - reset [ F("!r2:bar.org"), F("!r3:bar.org"), F("!r6:bar.org") ]; + reset [ "!r2:bar.org", "!r3:bar.org", "!r6:bar.org" ]; end; } assert_pending!(dynamic_entries_stream); @@ -1735,11 +1656,11 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { [dynamic_entries_stream] // Receive a `reset` again because the filter has been reset. reset [ - F("!r0:bar.org"), - F("!r1:bar.org"), - F("!r2:bar.org"), - F("!r3:bar.org"), - F("!r4:bar.org"), + "!r0:bar.org", + "!r1:bar.org", + "!r2:bar.org", + "!r3:bar.org", + "!r4:bar.org", // Stop! The page is full :-). ]; end; @@ -1754,9 +1675,9 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { [dynamic_entries_stream] // Receive the next values. append [ - F("!r5:bar.org"), - F("!r6:bar.org"), - F("!r7:bar.org"), + "!r5:bar.org", + "!r6:bar.org", + "!r7:bar.org", ]; end; }; @@ -1786,9 +1707,9 @@ async fn test_dynamic_entries_stream() -> Result<(), Error> { [dynamic_entries_stream] // Receive the next values. append [ - F("!r5:bar.org"), - F("!r6:bar.org"), - F("!r7:bar.org"), + "!r5:bar.org", + "!r6:bar.org", + "!r7:bar.org", ]; end; }; @@ -1832,20 +1753,10 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [0, 0], - "room_ids": [ - "!r0:bar.org", - ], - }, - ], }, }, "rooms": { "!r0:bar.org": { - "name": "This is ignored", "initial": true, "timeline": [], "required_state": [ @@ -1876,7 +1787,7 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { assert_entries_batch! { [dynamic_entries_stream] // Receive a `reset` because the filter has been reset/set for the first time. - reset [ F("!r0:bar.org") ]; + reset [ "!r0:bar.org" ]; end; }; assert_pending!(dynamic_entries_stream); @@ -1899,16 +1810,6 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [0, 1], - "room_ids": [ - "!r1:bar.org", - "!r0:bar.org", - ], - }, - ], }, VISIBLE_ROOMS: { "count": 0, @@ -1916,7 +1817,6 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { }, "rooms": { "!r1:bar.org": { - "name": "Matrix Bar", "initial": true, "timeline": [], "required_state": [ @@ -1939,77 +1839,17 @@ async fn test_dynamic_entries_stream_manual_update() -> Result<(), Error> { // Assert the dynamic entries. assert_entries_batch! { [dynamic_entries_stream] - set[0] [ F("!r1:bar.org") ]; - insert[1] [ F("!r0:bar.org") ]; - end; - }; - - // Variation 1: Send manual update after reading stream, !r0 should be at new - // pos 1 - let room = client.get_room(room_id!("!r0:bar.org")).unwrap(); - room.set_room_info(room.clone_info(), true); - - assert_entries_batch! { - [dynamic_entries_stream] - set[1] [ F("!r0:bar.org") ]; + push back [ "!r1:bar.org" ]; end; }; - assert_pending!(dynamic_entries_stream); - - sync_then_assert_request_and_fake_response! { - [server, room_list, sync] - states = Running => Running, - assert request >= { - "lists": { - ALL_ROOMS: { - "ranges": [[0, 9]], - }, - VISIBLE_ROOMS: { - "ranges": [[0, 19]], - }, - }, - }, - respond with = { - "pos": "2", - "lists": { - ALL_ROOMS: { - "count": 10, - "ops": [ - { - "op": "SYNC", - "range": [0, 1], - "room_ids": [ - "!r0:bar.org", - "!r1:bar.org", - ], - }, - ], - }, - VISIBLE_ROOMS: { - "count": 0, - }, - }, - "rooms": {}, - }, - }; - - // Variation 2: Send manual update before reading stream, !r0 should still be at - // previous pos 1 + // Send manual update after reading stream. let room = client.get_room(room_id!("!r0:bar.org")).unwrap(); room.set_room_info(room.clone_info(), true); assert_entries_batch! { [dynamic_entries_stream] - set[1] [ F("!r0:bar.org") ]; - end; - }; - - // Assert the dynamic entries. - assert_entries_batch! { - [dynamic_entries_stream] - set[0] [ F("!r0:bar.org") ]; - set[1] [ F("!r1:bar.org") ]; + set[0] [ "!r0:bar.org" ]; end; }; @@ -2036,21 +1876,10 @@ async fn test_room() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 2, - "ops": [ - { - "op": "SYNC", - "range": [0, 1], - "room_ids": [ - room_id_0, - room_id_1, - ], - }, - ], }, }, "rooms": { room_id_0: { - "name": "This is ignored", "avatar": "mxc://homeserver/media", "initial": true, "required_state": [ @@ -2098,15 +1927,6 @@ async fn test_room() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 2, - "ops": [ - { - "op": "SYNC", - "range": [1, 1], - "room_ids": [ - room_id_1, - ], - }, - ], }, }, "rooms": { @@ -2179,30 +1999,16 @@ async fn test_room_subscription() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 3, - "ops": [ - { - "op": "SYNC", - "range": [0, 2], - "room_ids": [ - room_id_0, - room_id_1, - room_id_2, - ], - }, - ], }, }, "rooms": { room_id_0: { - "name": "Room #0", "initial": true, }, room_id_1: { - "name": "Room #1", "initial": true, }, room_id_2: { - "name": "Room #2", "initial": true, } }, @@ -2299,18 +2105,10 @@ async fn test_room_unread_notifications() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 1, - "ops": [ - { - "op": "SYNC", - "range": [0, 0], - "room_ids": [room_id], - }, - ], }, }, "rooms": { room_id: { - "name": "Room #0", "initial": true, }, }, @@ -2371,18 +2169,10 @@ async fn test_room_timeline() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 2, - "ops": [ - { - "op": "SYNC", - "range": [0, 0], - "room_ids": [room_id], - }, - ], }, }, "rooms": { room_id: { - "name": "Room #0", "initial": true, "timeline": [ timeline_event!("$x0:bar.org" at 0 sec), @@ -2456,18 +2246,10 @@ async fn test_room_latest_event() -> Result<(), Error> { "lists": { ALL_ROOMS: { "count": 2, - "ops": [ - { - "op": "SYNC", - "range": [0, 0], - "room_ids": [room_id], - }, - ], }, }, "rooms": { room_id: { - "name": "Room #0", "initial": true, }, }, @@ -2564,6 +2346,7 @@ async fn test_room_latest_event() -> Result<(), Error> { Ok(()) } +/* #[async_test] async fn test_input_viewport() -> Result<(), Error> { let (_, server, room_list) = new_room_list_service().await?; @@ -2651,8 +2434,9 @@ async fn test_input_viewport() -> Result<(), Error> { Ok(()) } +*/ -#[ignore = "Flaky"] +// #[ignore = "Flaky"] #[async_test] async fn test_sync_indicator() -> Result<(), Error> { let (_, server, room_list) = new_room_list_service().await?; @@ -2840,4 +2624,3 @@ async fn test_sync_indicator() -> Result<(), Error> { Ok(()) } -*/