From 4423b59f0fec160bd8626c6f92b819995906000c Mon Sep 17 00:00:00 2001 From: GeekMr <140129782+WilliamWang1721@users.noreply.github.com> Date: Thu, 24 Sep 2026 18:12:37 +0800 Subject: [PATCH] test(ssh): cover duplicate host draft --- .../src/gpui_shell/ssh_settings/library/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nebula_app/src/gpui_shell/ssh_settings/library/tests.rs b/nebula_app/src/gpui_shell/ssh_settings/library/tests.rs index 53b87a1..7f4af4f 100644 --- a/nebula_app/src/gpui_shell/ssh_settings/library/tests.rs +++ b/nebula_app/src/gpui_shell/ssh_settings/library/tests.rs @@ -31,6 +31,9 @@ fn pairing_design_ssh_cards_keep_icon_anchors_and_compact_filter(cx: &mut gpui:: pinned: vec!["second-host".into()], ..Default::default() }; + let mut profile = pane.ssh_hosts.profiles.for_destination("nebula-test"); + profile.label = Some("Alpha".into()); + pane.ssh_hosts.profiles.upsert(profile); }); pane = Some(view.clone()); gpui_component::Root::new(view, window, cx) @@ -60,6 +63,16 @@ fn pairing_design_ssh_cards_keep_icon_anchors_and_compact_filter(cx: &mut gpui:: assert!(action.right() <= first.right()); } } + cx.update(|window, cx| { + pane.update(cx, |pane, cx| { + pane.duplicate_ssh_host("nebula-test".into(), window, cx); + assert!(pane.ssh_editor.as_ref().is_some_and(|editor| editor.original_destination.is_none())); + assert_eq!(pane.ssh_destination_input.read(cx).value(), ""); + assert_eq!(pane.ssh_label_input.read(cx).value(), "Alpha 1"); + pane.close_ssh_editor(window, cx); + }); + }); + let pin_filter = cx.debug_bounds("host-scope-1").unwrap(); let point = gpui::point(pin_filter.origin.x + px(4.0), pin_filter.center().y); cx.simulate_mouse_down(point, MouseButton::Left, gpui::Modifiers::default());