Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add test assertion where user is not admin of channel
Max Brunsfeld1762d2c6d436
diff --git a/crates/collab/src/db/tests.rs b/crates/collab/src/db/tests.rsindex 5ffcd127768..3067fd063e0 100644--- a/crates/collab/src/db/tests.rs+++ b/crates/collab/src/db/tests.rs@@ -952,7 +952,6 @@ test_both_dbs!(test_channels_postgres, test_channels_sqlite, db, {.unwrap();let (channels, _) = db.get_channels_for_user(a_id).await.unwrap();-assert_eq!(channels,vec![@@ -1001,6 +1000,37 @@ test_both_dbs!(test_channels_postgres, test_channels_sqlite, db, {]);+ let (channels, _) = db.get_channels_for_user(b_id).await.unwrap();+ assert_eq!(+ channels,+ vec![+ Channel {+ id: zed_id,+ name: "zed".to_string(),+ parent_id: None,+ user_is_admin: true,+ },+ Channel {+ id: crdb_id,+ name: "crdb".to_string(),+ parent_id: Some(zed_id),+ user_is_admin: false,+ },+ Channel {+ id: livestreaming_id,+ name: "livestreaming".to_string(),+ parent_id: Some(zed_id),+ user_is_admin: false,+ },+ Channel {+ id: replace_id,+ name: "replace".to_string(),+ parent_id: Some(zed_id),+ user_is_admin: false,+ },+ ]+ );+// Remove a single channeldb.remove_channel(crdb_id, a_id).await.unwrap();assert!(db.get_channel(crdb_id, a_id).await.unwrap().is_none());