From 85987baef034bc979534e07dcf58fd8d77f64daf Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 10 Nov 2026 21:51:38 +0100 Subject: [PATCH] Test: at the minimum width on macOS the main menu may be the folded Menu button (#6920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menu bar folds titles that don't fit into "⋯", or all of them into one "Menu" when not even the first fits. On hosted macOS, at MIN_WINDOW_SIZE, the bar is the Menu button (the system font is wider), so the test's File menu item wasn't there and it failed; the main menu is still reachable. A real macOS window uses the native menu bar. --- crates/ui-egui/tests/it/min_window.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/min_window.rs b/crates/ui-egui/tests/it/min_window.rs index f384eef0eb..263937df32 100644 --- a/crates/ui-egui/tests/it/min_window.rs +++ b/crates/ui-egui/tests/it/min_window.rs @@ -26,7 +26,12 @@ fn at_the_minimum_width_the_modes_fold_into_a_menu_and_search_stays() { h.get_by_role_and_label(Role::Button, "E-Sign").click(); h.run_steps(4); assert!(h.query_by_role_and_label(Role::Button, "E-Sign").is_some(), "the menu button is named after the mode"); - assert!(h.query_by_role_and_label(Role::MenuItem, "File").is_some(), "main menu reachable"); + // The menu bar folds the titles that don't fit into "⋯", or all of them into one "Menu" when not + // even the first fits (craft-menu's `MenuBarUi`). macOS's system font is wider, and at this width + // the bar is the "Menu" button there; a real macOS window has the native menu bar instead. + let menus = |label| h.query_by_role_and_label(Role::MenuItem, label).is_some(); + let folded = cfg!(target_os = "macos") && menus("Menu"); + assert!(menus("File") || folded, "main menu reachable"); } #[test]