Fix some tests (mostly more run_until_parked's...)
This commit is contained in:
parent
276bfa0fab
commit
2ca462722c
4 changed files with 9 additions and 11 deletions
|
@ -1337,6 +1337,7 @@ async fn test_guest_access(
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
executor.run_until_parked();
|
||||||
|
|
||||||
assert_channels_list_shape(client_b.channel_store(), cx_b, &[]);
|
assert_channels_list_shape(client_b.channel_store(), cx_b, &[]);
|
||||||
|
|
||||||
|
|
|
@ -234,14 +234,14 @@ async fn test_basic_following(
|
||||||
workspace_c.update(cx_c, |workspace, cx| {
|
workspace_c.update(cx_c, |workspace, cx| {
|
||||||
workspace.close_window(&Default::default(), cx);
|
workspace.close_window(&Default::default(), cx);
|
||||||
});
|
});
|
||||||
cx_c.update(|_| {
|
executor.run_until_parked();
|
||||||
drop(workspace_c);
|
|
||||||
});
|
|
||||||
cx_b.executor().run_until_parked();
|
|
||||||
// are you sure you want to leave the call?
|
// are you sure you want to leave the call?
|
||||||
cx_c.simulate_prompt_answer(0);
|
cx_c.simulate_prompt_answer(0);
|
||||||
cx_b.executor().run_until_parked();
|
cx_c.cx.update(|_| {
|
||||||
|
drop(workspace_c);
|
||||||
|
});
|
||||||
executor.run_until_parked();
|
executor.run_until_parked();
|
||||||
|
cx_c.cx.update(|_| {});
|
||||||
|
|
||||||
weak_workspace_c.assert_dropped();
|
weak_workspace_c.assert_dropped();
|
||||||
weak_project_c.assert_dropped();
|
weak_project_c.assert_dropped();
|
||||||
|
@ -1363,8 +1363,6 @@ async fn test_following_across_workspaces(cx_a: &mut TestAppContext, cx_b: &mut
|
||||||
let mut server = TestServer::start(executor.clone()).await;
|
let mut server = TestServer::start(executor.clone()).await;
|
||||||
let client_a = server.create_client(cx_a, "user_a").await;
|
let client_a = server.create_client(cx_a, "user_a").await;
|
||||||
let client_b = server.create_client(cx_b, "user_b").await;
|
let client_b = server.create_client(cx_b, "user_b").await;
|
||||||
cx_a.update(editor::init);
|
|
||||||
cx_b.update(editor::init);
|
|
||||||
|
|
||||||
client_a
|
client_a
|
||||||
.fs()
|
.fs()
|
||||||
|
@ -1400,9 +1398,6 @@ async fn test_following_across_workspaces(cx_a: &mut TestAppContext, cx_b: &mut
|
||||||
let (workspace_a, cx_a) = client_a.build_workspace(&project_a, cx_a);
|
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);
|
let (workspace_b, cx_b) = client_b.build_workspace(&project_b, cx_b);
|
||||||
|
|
||||||
cx_a.update(|cx| collab_ui::init(&client_a.app_state, cx));
|
|
||||||
cx_b.update(|cx| collab_ui::init(&client_b.app_state, cx));
|
|
||||||
|
|
||||||
active_call_a
|
active_call_a
|
||||||
.update(cx_a, |call, cx| call.share_project(project_a.clone(), cx))
|
.update(cx_a, |call, cx| call.share_project(project_a.clone(), cx))
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -3065,6 +3065,7 @@ async fn test_local_settings(
|
||||||
.update(cx_a, |call, cx| call.share_project(project_a.clone(), cx))
|
.update(cx_a, |call, cx| call.share_project(project_a.clone(), cx))
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
executor.run_until_parked();
|
||||||
|
|
||||||
// As client B, join that project and observe the local settings.
|
// As client B, join that project and observe the local settings.
|
||||||
let project_b = client_b.build_remote_project(project_id, cx_b).await;
|
let project_b = client_b.build_remote_project(project_id, cx_b).await;
|
||||||
|
|
|
@ -545,7 +545,8 @@ use derive_more::{Deref, DerefMut};
|
||||||
pub struct VisualTestContext {
|
pub struct VisualTestContext {
|
||||||
#[deref]
|
#[deref]
|
||||||
#[deref_mut]
|
#[deref_mut]
|
||||||
cx: TestAppContext,
|
/// cx is the original TestAppContext (you can more easily access this using Deref)
|
||||||
|
pub cx: TestAppContext,
|
||||||
window: AnyWindowHandle,
|
window: AnyWindowHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue