Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Test removing a contact

Petros Amoiridise928c1c61e4a
diff --git a/crates/collab/src/tests/integration_tests.rs b/crates/collab/src/tests/integration_tests.rs
index 3f2a777f879..a645d6dc71e 100644
--- a/crates/collab/src/tests/integration_tests.rs
+++ b/crates/collab/src/tests/integration_tests.rs
@@ -5291,6 +5291,27 @@ async fn test_contacts(
[("user_b".to_string(), "online", "free")]
);
+ // Test removing a contact
+ client_b
+ .user_store
+ .update(cx_b, |store, cx| {
+ store.remove_contact(client_c.user_id().unwrap(), cx)
+ })
+ .await
+ .unwrap();
+ deterministic.run_until_parked();
+ assert_eq!(
+ contacts(&client_b, cx_b),
+ [
+ ("user_a".to_string(), "offline", "free"),
+ ("user_d".to_string(), "online", "free")
+ ]
+ );
+ assert_eq!(
+ contacts(&client_c, cx_c),
+ [("user_a".to_string(), "offline", "free"),]
+ );
+
fn contacts(
client: &TestClient,
cx: &TestAppContext,