Retire the obsolete source close event and use current drawer controls in tests
This commit is contained in:
@@ -85,6 +85,11 @@ fn symbol(app: &mut App, event: nav::SymbolEvent) {
|
||||
send(app, message);
|
||||
}
|
||||
|
||||
fn close_drawer(app: &mut App) {
|
||||
let message = Message::TextWorkspace(TextEvent::HideDrawer(app.text_drawer_context()));
|
||||
send(app, message);
|
||||
}
|
||||
|
||||
fn choice(app: &App, stamp: query::QueryStamp, reference: bool, index: usize) -> Message {
|
||||
app.source_symbol_message(nav::SymbolEvent::Choose {
|
||||
stamp,
|
||||
@@ -414,7 +419,7 @@ fn close_during_busy_retains_hidden_completion_without_reopening_or_navigation()
|
||||
let raw = app.source_workspace.bundle();
|
||||
let cursor = app.source_editor.cursor();
|
||||
assert!(references_visible(&app));
|
||||
symbol(&mut app, nav::SymbolEvent::Close);
|
||||
close_drawer(&mut app);
|
||||
assert!(app.text_workspace.drawer().is_none());
|
||||
assert_eq!(app.source_symbols.in_flight, Some(request.job));
|
||||
assert!(app.source_symbols.request.is_none());
|
||||
@@ -561,7 +566,7 @@ fn closed_results_stay_closed_on_exact_back_and_reopen_only_for_a_return_notice(
|
||||
let origin = app.source_editor.cursor();
|
||||
finish(&mut app, query::Action::Definition);
|
||||
reveal(&mut app);
|
||||
symbol(&mut app, nav::SymbolEvent::Close);
|
||||
close_drawer(&mut app);
|
||||
assert!(app.text_workspace.drawer().is_none() && app.source_symbols.results.is_some());
|
||||
if changed {
|
||||
// Use the workspace edit API to give the origin a new generation.
|
||||
@@ -1433,7 +1438,7 @@ fn stale_envelope_trial(reset: bool) {
|
||||
let old_messages = [
|
||||
app.source_symbol_message(nav::SymbolEvent::Query(query::Action::Definition)),
|
||||
app.source_symbol_message(nav::SymbolEvent::Back),
|
||||
app.source_symbol_message(nav::SymbolEvent::Close),
|
||||
Message::TextWorkspace(TextEvent::HideDrawer(app.text_drawer_context())),
|
||||
choice(&app, old_results.stamp, false, 0),
|
||||
];
|
||||
if reset {
|
||||
@@ -1494,7 +1499,7 @@ fn stale_envelope_trial(reset: bool) {
|
||||
// Replay once more with no busy-slot fallback and visible current results.
|
||||
assert_stale_envelopes_preserve_current(&mut app, &old_messages);
|
||||
let interaction = app.source_symbols.interaction;
|
||||
symbol(&mut app, nav::SymbolEvent::Close);
|
||||
close_drawer(&mut app);
|
||||
assert_ne!(app.source_symbols.interaction, interaction);
|
||||
assert!(app.text_workspace.drawer().is_none() && app.source_symbols.results.is_some());
|
||||
let next = begin(&mut app, query::Action::References);
|
||||
|
||||
Reference in New Issue
Block a user