diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-06 16:27:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-06 16:27:52 +0200 |
| commit | 9d111db9c83823eb4ce8623d9707e28153b01334 (patch) | |
| tree | 58ff584b1fc79e23dc00f093860908c9bad4f2b7 /src/client/shell/tests/endpoint_requests.rs | |
| parent | 5a64e8da4551990367dd26d77cf3b654dfa27a73 (diff) | |
fix: keep manual selections active during terminal output (#3684)
Diffstat (limited to 'src/client/shell/tests/endpoint_requests.rs')
| -rw-r--r-- | src/client/shell/tests/endpoint_requests.rs | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/client/shell/tests/endpoint_requests.rs b/src/client/shell/tests/endpoint_requests.rs index ab5a3cb2..f05b8462 100644 --- a/src/client/shell/tests/endpoint_requests.rs +++ b/src/client/shell/tests/endpoint_requests.rs @@ -216,7 +216,7 @@ fn cancelled_integration_install_does_not_queue_a_refresh() { } #[test] -fn cancelled_selection_does_not_send_terminal_input() { +fn failed_selection_copy_does_not_send_terminal_input() { let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); state.set_snapshot(Box::new(snapshot())); state.set_pane_surface(surface()); @@ -225,18 +225,27 @@ fn cancelled_selection_does_not_send_terminal_input() { (0, 0), (0, 2), )); - let mut outcome = ClientShellInput::default(); - state.request_selection_copy(&mut outcome); - let (_, actions) = state.handle_endpoint_result( - "boot-1", - request_id(&outcome.actions), + for result in [ + Ok(crate::api::schema::ResponseResult::PaneSelection { + pane_id: "pane_1".into(), + text: String::new(), + }), Err(ClientShellEndpointError { code: Some("endpoint_cancelled".into()), message: "cancelled".into(), }), - ); - assert!(actions.is_empty()); - assert!(state.pending_requests.is_empty()); + Err(ClientShellEndpointError { + code: Some("selection_unavailable".into()), + message: "selection text is unavailable".into(), + }), + ] { + let mut outcome = ClientShellInput::default(); + state.request_selection_copy(&mut outcome, false); + let (_, actions) = + state.handle_endpoint_result("boot-1", request_id(&outcome.actions), result); + assert!(actions.is_empty()); + assert!(state.pending_requests.is_empty()); + } } #[test] |
