mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
uncomment and augment mouse_context_menu tests
This commit is contained in:
parent
3b1a0652ae
commit
ff734d494f
1 changed files with 36 additions and 35 deletions
|
@ -69,42 +69,43 @@ pub fn deploy_context_menu(
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
// #[cfg(test)]
|
||||
// mod tests {
|
||||
// use super::*;
|
||||
// use crate::{editor_tests::init_test, test::editor_lsp_test_context::EditorLspTestContext};
|
||||
// use indoc::indoc;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{editor_tests::init_test, test::editor_lsp_test_context::EditorLspTestContext};
|
||||
use indoc::indoc;
|
||||
|
||||
// #[gpui::test]
|
||||
// async fn test_mouse_context_menu(cx: &mut gpui::TestAppContext) {
|
||||
// init_test(cx, |_| {});
|
||||
#[gpui::test]
|
||||
async fn test_mouse_context_menu(cx: &mut gpui::TestAppContext) {
|
||||
init_test(cx, |_| {});
|
||||
|
||||
// let mut cx = EditorLspTestContext::new_rust(
|
||||
// lsp::ServerCapabilities {
|
||||
// hover_provider: Some(lsp::HoverProviderCapability::Simple(true)),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// cx,
|
||||
// )
|
||||
// .await;
|
||||
let mut cx = EditorLspTestContext::new_rust(
|
||||
lsp::ServerCapabilities {
|
||||
hover_provider: Some(lsp::HoverProviderCapability::Simple(true)),
|
||||
..Default::default()
|
||||
},
|
||||
cx,
|
||||
)
|
||||
.await;
|
||||
|
||||
// cx.set_state(indoc! {"
|
||||
// fn teˇst() {
|
||||
// do_work();
|
||||
// }
|
||||
// "});
|
||||
// let point = cx.display_point(indoc! {"
|
||||
// fn test() {
|
||||
// do_wˇork();
|
||||
// }
|
||||
// "});
|
||||
// cx.update_editor(|editor, cx| deploy_context_menu(editor, Default::default(), point, cx));
|
||||
cx.set_state(indoc! {"
|
||||
fn teˇst() {
|
||||
do_work();
|
||||
}
|
||||
"});
|
||||
let point = cx.display_point(indoc! {"
|
||||
fn test() {
|
||||
do_wˇork();
|
||||
}
|
||||
"});
|
||||
cx.editor(|editor, app| assert!(editor.mouse_context_menu.is_none()));
|
||||
cx.update_editor(|editor, cx| deploy_context_menu(editor, Default::default(), point, cx));
|
||||
|
||||
// cx.assert_editor_state(indoc! {"
|
||||
// fn test() {
|
||||
// do_wˇork();
|
||||
// }
|
||||
// "});
|
||||
// cx.editor(|editor, app| assert!(editor.mouse_context_menu.read(app).visible()));
|
||||
// }
|
||||
// }
|
||||
cx.assert_editor_state(indoc! {"
|
||||
fn test() {
|
||||
do_wˇork();
|
||||
}
|
||||
"});
|
||||
cx.editor(|editor, app| assert!(editor.mouse_context_menu.is_some()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue