From 15631a6fd51ea5647bcc847ed51223cc9fdffd9c Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 27 Jul 2023 21:31:01 -0700 Subject: [PATCH] Add channel_tests.rs --- crates/collab/src/tests/channel_tests.rs | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 crates/collab/src/tests/channel_tests.rs diff --git a/crates/collab/src/tests/channel_tests.rs b/crates/collab/src/tests/channel_tests.rs new file mode 100644 index 0000000000000000000000000000000000000000..24754adeb3adacf40ae4ef657ef460d34274c13c --- /dev/null +++ b/crates/collab/src/tests/channel_tests.rs @@ -0,0 +1,29 @@ +use gpui::{executor::Deterministic, TestAppContext}; +use std::sync::Arc; + +use super::TestServer; + +#[gpui::test] +async fn test_basic_channels(deterministic: Arc, cx: &mut TestAppContext) { + deterministic.forbid_parking(); + let mut server = TestServer::start(&deterministic).await; + let client_a = server.create_client(cx, "user_a").await; + let a_id = crate::db::UserId(client_a.user_id().unwrap() as i32); + let db = server._test_db.db(); + + let zed_id = db.create_channel("zed").await.unwrap(); + + db.add_channel_member(zed_id, a_id).await.unwrap(); + + let channels = db.get_channels(a_id).await; + + assert_eq!(channels, vec![zed_id]); +} + +/* +Linear things: +- A way of expressing progress to the team +- A way for us to agree on a scope +- A way to figure out what we're supposed to be doing + +*/