Ensure focus-sensitive tests have active windows

This commit is contained in:
Conrad Irwin 2024-01-09 21:37:25 -07:00
parent 1bf33b4b61
commit 72c022f413
4 changed files with 11 additions and 1 deletions

View file

@ -76,6 +76,10 @@ async fn test_basic_following(
let (workspace_a, cx_a) = client_a.build_workspace(&project_a, cx_a);
let (workspace_b, cx_b) = client_b.build_workspace(&project_b, cx_b);
cx_b.update(|cx| {
assert!(cx.is_window_active());
});
// Client A opens some editors.
let pane_a = workspace_a.update(cx_a, |workspace, _| workspace.active_pane().clone());
let editor_a1 = workspace_a

View file

@ -617,7 +617,10 @@ impl TestClient {
project: &Model<Project>,
cx: &'a mut TestAppContext,
) -> (View<Workspace>, &'a mut VisualTestContext) {
cx.add_window_view(|cx| Workspace::new(0, project.clone(), self.app_state.clone(), cx))
cx.add_window_view(|cx| {
cx.activate_window();
Workspace::new(0, project.clone(), self.app_state.clone(), cx)
})
}
}