From be677a8a4b76b9a974177508bbec69d78c9a3c77 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 1 Apr 2022 15:27:06 +0200 Subject: [PATCH] Don't assume the `CloseActiveItem` action is synchronous in test --- crates/zed/src/zed.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 24bdf4c0ef..00f57ccccb 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -683,6 +683,8 @@ mod tests { #[gpui::test] async fn test_pane_actions(cx: &mut TestAppContext) { + cx.foreground().forbid_parking(); + cx.update(|cx| pane::init(cx)); let app_state = cx.update(test_app_state); app_state @@ -740,7 +742,9 @@ mod tests { assert_eq!(pane2_item.project_path(cx.as_ref()), Some(file1.clone())); cx.dispatch_action(window_id, vec![pane_2.id()], &workspace::CloseActiveItem); - let workspace = workspace.read(cx); + }); + cx.foreground().run_until_parked(); + workspace.read_with(cx, |workspace, _| { assert_eq!(workspace.panes().len(), 1); assert_eq!(workspace.active_pane(), &pane_1); });