From 7ea1eb13b02b36e53bdd6bd859da798c757b3b69 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Thu, 5 Nov 2026 12:56:01 -0500 Subject: [PATCH] Tab menu test: the clicked tab is not the active one (#11403) The multi-document Move to New Window test now makes document 0 active and clicks the menu on tab 2, then checks that tab 2 floated and document 0 did not. Before, the clicked tab was also the active one, so a regression that floated the active document would have passed. Co-Authored-By: Claude Fable 5.1 --- crates/ui-egui/src/doc_tab_menu_tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/doc_tab_menu_tests.rs b/crates/ui-egui/src/doc_tab_menu_tests.rs index d82798e69da..090455bd590 100644 --- a/crates/ui-egui/src/doc_tab_menu_tests.rs +++ b/crates/ui-egui/src/doc_tab_menu_tests.rs @@ -166,10 +166,15 @@ fn move_to_new_window_floats_the_clicked_tab_even_with_one_document() { crate::menus::invoke(&mut h.state_mut().app, &ctx, id, params).unwrap(); assert!(h.state().app.ui.windows.iter().any(|w| w.floating && w.document == 0)); + // The clicked tab (2) is not the active document (0). let (mut h, _) = probe(3, 2, true); + h.state_mut().app.session.set_active(0); + assert_eq!(h.state().app.session.active_index(), Some(0)); let (id, params) = click(&mut h, "Move to New Window"); crate::menus::invoke(&mut h.state_mut().app, &ctx, id, params).unwrap(); - assert!(h.state().app.ui.windows.iter().any(|w| w.floating && w.document == 2), "the clicked tab, not the active one"); + let windows = &h.state().app.ui.windows; + assert!(windows.iter().any(|w| w.floating && w.document == 2), "the clicked tab floats"); + assert!(!windows.iter().any(|w| w.document == 0), "the active document does not float"); } #[test]