aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/tests
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-22 19:12:29 +0300
committerGitHub <noreply@github.com>2026-09-22 19:12:29 +0300
commit1c6397b1cddb288099ed212a5979732698bd72c2 (patch)
tree0574b428903ea1ce106bc7ba36e213c0418aa9f4 /src/client/shell/tests
parent7237703dc59102cf3097e833eb896b314007b548 (diff)
fix: reuse ssh authentication and add machine recovery commands (#4490)
* fix: reuse ssh authentication and add in-app mfa recovery refs #3763 * refactor: move ssh recovery to machine cli refs #3763
Diffstat (limited to 'src/client/shell/tests')
-rw-r--r--src/client/shell/tests/endpoints.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/client/shell/tests/endpoints.rs b/src/client/shell/tests/endpoints.rs
index 4434e119..f327f8c1 100644
--- a/src/client/shell/tests/endpoints.rs
+++ b/src/client/shell/tests/endpoints.rs
@@ -73,6 +73,45 @@ fn state_with_remote() -> (ClientShellState, ClientEndpointId) {
(state, endpoint_id)
}
+#[test]
+fn machine_diagnostic_badge_reopens_notice_without_collapsing_machine() {
+ let (mut state, id) = state_with_remote();
+ state.set_endpoint_status(&id, ClientEndpointStatus::Attention);
+ state.set_machine_diagnostic(&id, "Permission denied (keyboard-interactive)".into());
+ for _ in 0..2 {
+ state.compose(120, 40).unwrap();
+ let hit = state
+ .hits
+ .machines
+ .iter()
+ .find(|hit| hit.endpoint_id == id)
+ .unwrap();
+ let mouse = MouseEvent {
+ kind: MouseEventKind::Down(MouseButton::Left),
+ column: hit.status_badge.x,
+ row: hit.status_badge.y,
+ modifiers: KeyModifiers::NONE,
+ };
+ let outcome = state.handle_raw_events(vec![RawInputEvent::Mouse(mouse)]);
+ assert!(outcome.repaint);
+ assert!(!state.collapsed_endpoints.contains(&id));
+ let notice = state.visible_endpoint_notice.take().unwrap();
+ assert!(notice.body.contains("Permission denied"));
+ assert!(notice
+ .title
+ .contains("herdr machine reconnect 0123456789abcdef0123456789abcdef"));
+ }
+ state.set_endpoint_status(&id, ClientEndpointStatus::Online);
+ state.compose(120, 40).unwrap();
+ assert!(!state.machine_diagnostics.required_for(
+ state
+ .endpoints
+ .iter()
+ .find(|endpoint| endpoint.endpoint_id == id)
+ .unwrap()
+ ));
+}
+
fn state_with_scrollable_agents() -> (ClientShellState, ClientEndpointId) {
let (mut state, remote) = state_with_remote();
for endpoint_id in [ClientEndpointId::Local, remote.clone()] {