From 3bc7024f8b2a568ec219c413399ea1faba280844 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Tue, 3 Oct 2023 20:01:10 -0700 Subject: [PATCH] Fix unit test co-authored-by: Conrad --- crates/collab/src/tests/channel_buffer_tests.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/collab/src/tests/channel_buffer_tests.rs b/crates/collab/src/tests/channel_buffer_tests.rs index 41662f10c4..82bd7e6afe 100644 --- a/crates/collab/src/tests/channel_buffer_tests.rs +++ b/crates/collab/src/tests/channel_buffer_tests.rs @@ -804,11 +804,13 @@ async fn test_channel_buffer_changes( assert!(has_buffer_changed); // Opening the buffer should clear the changed flag. - let channel_buffer_b = client_b - .channel_store() - .update(cx_b, |store, cx| store.open_channel_buffer(channel_id, cx)) + let project_b = client_b.build_empty_local_project(cx_b); + let workspace_b = client_b.build_workspace(&project_b, cx_b).root(cx_b); + let channel_view_b = cx_b + .update(|cx| ChannelView::open(channel_id, workspace_b.clone(), cx)) .await .unwrap(); + deterministic.run_until_parked(); let has_buffer_changed = cx_b.read(|cx| { @@ -840,8 +842,12 @@ async fn test_channel_buffer_changes( assert!(!has_buffer_changed); // Closing the buffer should re-enable change tracking - cx_b.update(|_| { - drop(channel_buffer_b); + cx_b.update(|cx| { + workspace_b.update(cx, |workspace, cx| { + workspace.close_all_items_and_panes(&Default::default(), cx) + }); + + drop(channel_view_b) }); deterministic.run_until_parked();