mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 03:55:42 -04:00
test(ui): Test that RoomList receives State updates even if the same.
`RoomList::state` provides a `Subscriber` to the `State`. This patch modifies the way the state is tested, to ensure that there is always an update broadcasted even if the state is the same (e.g. if the state moves from `CarryOn` to `CarryOn`).
This commit is contained in:
@@ -83,7 +83,9 @@ macro_rules! sync_then_assert_request_and_fake_response {
|
||||
$(
|
||||
use State::*;
|
||||
|
||||
assert_matches!($room_list.state().get(), $pre_state, "pre state");
|
||||
let mut state = $room_list.state();
|
||||
|
||||
assert_matches!(state.get(), $pre_state, "pre state");
|
||||
)?
|
||||
|
||||
let next = $room_list_sync_stream.next().await;
|
||||
@@ -107,7 +109,7 @@ macro_rules! sync_then_assert_request_and_fake_response {
|
||||
}
|
||||
}
|
||||
|
||||
$( assert_matches!($room_list.state().get(), $post_state, "post state"); )?
|
||||
$( assert_matches!(state.next().now_or_never(), Some(Some($post_state)), "post state"); )?
|
||||
|
||||
next
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user