From 51574427036bf619acd62174ce8c436efd779e04 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 3 May 2023 19:00:32 +0200 Subject: [PATCH] Fix integration test relying on deferred happening after focus Focus is now one of the last things that happens during `flush_effects`, and we shouldn't have relied on `defer` in the first place to verify focus changes. --- crates/collab/src/tests/integration_tests.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/collab/src/tests/integration_tests.rs b/crates/collab/src/tests/integration_tests.rs index c6f51a9dc4..36dcff81be 100644 --- a/crates/collab/src/tests/integration_tests.rs +++ b/crates/collab/src/tests/integration_tests.rs @@ -6804,13 +6804,10 @@ async fn test_peers_following_each_other( // Clients A and B follow each other in split panes workspace_a.update(cx_a, |workspace, cx| { workspace.split_pane(workspace.active_pane().clone(), SplitDirection::Right, cx); - let pane_a1 = pane_a1.clone(); - cx.defer(move |workspace, _| { - assert_ne!(*workspace.active_pane(), pane_a1); - }); }); workspace_a .update(cx_a, |workspace, cx| { + assert_ne!(*workspace.active_pane(), pane_a1); let leader_id = *project_a.read(cx).collaborators().keys().next().unwrap(); workspace.toggle_follow(leader_id, cx).unwrap() }) @@ -6818,13 +6815,10 @@ async fn test_peers_following_each_other( .unwrap(); workspace_b.update(cx_b, |workspace, cx| { workspace.split_pane(workspace.active_pane().clone(), SplitDirection::Right, cx); - let pane_b1 = pane_b1.clone(); - cx.defer(move |workspace, _| { - assert_ne!(*workspace.active_pane(), pane_b1); - }); }); workspace_b .update(cx_b, |workspace, cx| { + assert_ne!(*workspace.active_pane(), pane_b1); let leader_id = *project_b.read(cx).collaborators().keys().next().unwrap(); workspace.toggle_follow(leader_id, cx).unwrap() })