Test: at the minimum width on macOS the main menu may be the folded Menu button (#6920)

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.
This commit is contained in:
FredApps authored and GitHub committed 2026-11-10 21:51:38 +01:00
1 parent 3df6be4eff
commit 85987baef0
1 file changed
+6 -1
+6 -1
View File
@@ -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]