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:
Ivan Enderlin
2023-06-15 09:55:57 +02:00
parent ddffa00589
commit c07bb0ec39

View File

@@ -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
}