mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 15:42:53 +00:00
Ensure client A and B can communicate after reconnection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
8de18b5a84
commit
3c61a3e826
1 changed files with 38 additions and 0 deletions
|
@ -1831,6 +1831,44 @@ mod tests {
|
|||
})
|
||||
.await;
|
||||
|
||||
// Ensure client A and B can communicate normally after reconnection.
|
||||
channel_a
|
||||
.update(&mut cx_a, |channel, cx| {
|
||||
channel.send_message("you online?".to_string(), cx).unwrap()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
channel_b
|
||||
.condition(&cx_b, |channel, _| {
|
||||
channel_messages(channel)
|
||||
== [
|
||||
("user_b".to_string(), "hello A, it's B.".to_string()),
|
||||
("user_a".to_string(), "oh, hi B.".to_string()),
|
||||
("user_a".to_string(), "sup".to_string()),
|
||||
("user_a".to_string(), "you online?".to_string()),
|
||||
]
|
||||
})
|
||||
.await;
|
||||
|
||||
channel_b
|
||||
.update(&mut cx_b, |channel, cx| {
|
||||
channel.send_message("yep".to_string(), cx).unwrap()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
channel_a
|
||||
.condition(&cx_a, |channel, _| {
|
||||
channel_messages(channel)
|
||||
== [
|
||||
("user_b".to_string(), "hello A, it's B.".to_string()),
|
||||
("user_a".to_string(), "oh, hi B.".to_string()),
|
||||
("user_a".to_string(), "sup".to_string()),
|
||||
("user_a".to_string(), "you online?".to_string()),
|
||||
("user_b".to_string(), "yep".to_string()),
|
||||
]
|
||||
})
|
||||
.await;
|
||||
|
||||
fn channel_messages(channel: &Channel) -> Vec<(String, String)> {
|
||||
channel
|
||||
.messages()
|
||||
|
|
Loading…
Reference in a new issue