aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/tests/endpoints.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/shell/tests/endpoints.rs')
-rw-r--r--src/client/shell/tests/endpoints.rs57
1 files changed, 37 insertions, 20 deletions
diff --git a/src/client/shell/tests/endpoints.rs b/src/client/shell/tests/endpoints.rs
index e4914971..4434e119 100644
--- a/src/client/shell/tests/endpoints.rs
+++ b/src/client/shell/tests/endpoints.rs
@@ -2056,18 +2056,16 @@ fn navigator_uses_machine_parents_only_for_federated_clients() {
assert!(rows.iter().all(|row| match row.target {
ClientNavigatorTarget::Machine { .. } => row.depth == 0 && row.status.is_none(),
ClientNavigatorTarget::Workspace { .. } => row.depth == 1 && row.status.is_none(),
- ClientNavigatorTarget::Tab { .. } => row.depth == 2 && row.status.is_none(),
- ClientNavigatorTarget::Pane { .. } => row.depth == 3 && row.status.is_some(),
+ ClientNavigatorTarget::Pane { .. } => row.depth == 2 && row.status.is_some(),
}));
assert_eq!(rows.iter().filter(|row| row.current).count(), 1);
let frame = state.compose(106, 30).expect("federated navigator");
for (rect, target) in &state.hits.navigator_rows {
let expected = match target {
- ClientNavigatorTarget::Machine { .. } => " ▾ ",
- ClientNavigatorTarget::Workspace { .. } => " ▾ ",
- ClientNavigatorTarget::Tab { .. } => " └── ",
- ClientNavigatorTarget::Pane { .. } => " └── ",
+ ClientNavigatorTarget::Machine { .. } => " ",
+ ClientNavigatorTarget::Workspace { .. } => " ",
+ ClientNavigatorTarget::Pane { .. } => " └─ ",
};
let prefix = frame.cells[rect.y as usize * frame.width as usize + rect.x as usize..]
.iter()
@@ -2105,8 +2103,7 @@ fn navigator_uses_machine_parents_only_for_federated_clients() {
.all(|row| !matches!(row.target, ClientNavigatorTarget::Machine { .. })));
assert!(rows.iter().all(|row| match row.target {
ClientNavigatorTarget::Workspace { .. } => row.depth == 0,
- ClientNavigatorTarget::Tab { .. } => row.depth == 1,
- ClientNavigatorTarget::Pane { .. } => row.depth == 2,
+ ClientNavigatorTarget::Pane { .. } => row.depth == 1,
ClientNavigatorTarget::Machine { .. } => false,
}));
}
@@ -2143,10 +2140,6 @@ fn navigator_keeps_saved_machine_visible_before_metadata_arrives() {
endpoint_id: target,
..
}
- | ClientNavigatorTarget::Tab {
- endpoint_id: target,
- ..
- }
| ClientNavigatorTarget::Pane {
endpoint_id: target,
..
@@ -2497,7 +2490,32 @@ fn collapsed_aggregate_workspace_status_uses_its_status_color() {
}
#[test]
-fn navigator_foreign_tab_selection_keeps_the_tab_target() {
+fn navigator_workspace_arrows_cross_machine_headings_without_activating_them() {
+ let (mut state, endpoint_id) = state_with_remote();
+ state.open_navigator_overlay();
+ for (key, expected_endpoint) in [
+ (KeyCode::Right, endpoint_id),
+ (KeyCode::Left, ClientEndpointId::Local),
+ ] {
+ let outcome = state.handle_raw_events(vec![RawInputEvent::Key(
+ crate::input::TerminalKey::new(key, KeyModifiers::empty()),
+ )]);
+ assert!(outcome.actions.is_empty());
+ let Some(ClientShellOverlay::Navigator(navigator)) = &state.overlay else {
+ panic!("navigator");
+ };
+ assert_eq!(
+ navigator.selected,
+ Some(ClientNavigatorTarget::Pane {
+ endpoint_id: expected_endpoint,
+ pane_id: "pane_1".into(),
+ })
+ );
+ }
+}
+
+#[test]
+fn navigator_foreign_workspace_heading_keeps_the_workspace_target() {
let (mut state, endpoint_id) = state_with_remote();
state.open_navigator_overlay();
let selected = {
@@ -2510,15 +2528,14 @@ fn navigator_foreign_tab_selection_keeps_the_tab_target() {
.find(|row| {
matches!(
&row.target,
- ClientNavigatorTarget::Tab {
+ ClientNavigatorTarget::Workspace {
endpoint_id: target_endpoint,
- tab_id,
- ..
- } if target_endpoint == &endpoint_id && tab_id == "tab_1"
+ workspace_id,
+ } if target_endpoint == &endpoint_id && workspace_id == "ws_1"
)
})
.map(|row| row.target.clone())
- .expect("remote tab row")
+ .expect("remote workspace heading")
};
if let Some(ClientShellOverlay::Navigator(navigator)) = state.overlay.as_mut() {
navigator.selected = Some(selected);
@@ -2531,7 +2548,7 @@ fn navigator_foreign_tab_selection_keeps_the_tab_target() {
outcome.actions.as_slice(),
[ClientShellAction::ActivateEndpoint {
endpoint_id: activated,
- target: Some(ClientEndpointFocusTarget::Tab(tab_id)),
- }] if activated == &endpoint_id && tab_id == "tab_1"
+ target: Some(ClientEndpointFocusTarget::Workspace(workspace_id)),
+ }] if activated == &endpoint_id && workspace_id == "ws_1"
));
}