1use call::Room;
2use gpui::{Model, TestAppContext};
3
4mod channel_buffer_tests;
5mod channel_message_tests;
6mod channel_tests;
7mod editor_tests;
8mod following_tests;
9mod integration_tests;
10mod notification_tests;
11mod random_channel_buffer_tests;
12mod random_project_collaboration_tests;
13mod randomized_test_helpers;
14mod test_server;
15
16pub use crate as collab2;
17pub use randomized_test_helpers::{
18 run_randomized_test, save_randomized_test_plan, RandomizedTest, TestError, UserTestPlan,
19};
20pub use test_server::{TestClient, TestServer};
21
22#[derive(Debug, Eq, PartialEq)]
23struct RoomParticipants {
24 remote: Vec<String>,
25 pending: Vec<String>,
26}
27
28fn room_participants(room: &Model<Room>, cx: &mut TestAppContext) -> RoomParticipants {
29 room.read_with(cx, |room, _| {
30 let mut remote = room
31 .remote_participants()
32 .iter()
33 .map(|(_, participant)| participant.user.github_login.clone())
34 .collect::<Vec<_>>();
35 let mut pending = room
36 .pending_participants()
37 .iter()
38 .map(|user| user.github_login.clone())
39 .collect::<Vec<_>>();
40 remote.sort();
41 pending.sort();
42 RoomParticipants { remote, pending }
43 })
44}
45
46fn channel_id(room: &Model<Room>, cx: &mut TestAppContext) -> Option<u64> {
47 cx.read(|cx| room.read(cx).channel_id())
48}