From 985d216e4ba467ea7e1a77b23534974c6054a36f Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 17 Feb 2022 17:30:10 +0100 Subject: [PATCH] Make completion unit test on editor more resilient --- crates/editor/src/editor.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index cc476af5fc..cb2e26b9f8 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -7791,7 +7791,9 @@ mod tests { ], ) .await; - editor.next_notification(&cx).await; + editor + .condition(&cx, |editor, _| editor.context_menu_visible()) + .await; let apply_additional_edits = editor.update(&mut cx, |editor, cx| { editor.move_down(&MoveDown, cx); @@ -7855,7 +7857,7 @@ mod tests { ) .await; editor - .condition(&cx, |editor, _| editor.context_menu.is_some()) + .condition(&cx, |editor, _| editor.context_menu_visible()) .await; editor.update(&mut cx, |editor, cx| { @@ -7873,7 +7875,9 @@ mod tests { ], ) .await; - editor.next_notification(&cx).await; + editor + .condition(&cx, |editor, _| editor.context_menu_visible()) + .await; let apply_additional_edits = editor.update(&mut cx, |editor, cx| { let apply_additional_edits = editor