From ef13c81f4e64cca17f077c839db14b9d0bd94db5 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Thu, 5 Nov 2026 08:46:31 -0500 Subject: [PATCH] Menu label test: the Clear Recent File List item is greyed with nothing to clear (#11399) From review: the test named the empty-list case but did not check it. Co-Authored-By: Claude Fable 5.1 --- crates/ui-egui/src/menu_item_labels_tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/menu_item_labels_tests.rs b/crates/ui-egui/src/menu_item_labels_tests.rs index 513665f4573..6e09df739fe 100644 --- a/crates/ui-egui/src/menu_item_labels_tests.rs +++ b/crates/ui-egui/src/menu_item_labels_tests.rs @@ -38,6 +38,12 @@ fn open_recent_clear_item_is_labelled_with_and_without_recent_files() { assert_eq!(clear.label, "Clear Recent File List"); assert!(clear.enabled); assert_eq!(clear.path, vec!["File".to_string(), "Open Recent".to_string()]); + // With nothing to clear the item stays in the submenu, greyed. + app.ui.recent_files.clear(); + let items = menu_items(&app); + let clear = items.iter().find(|i| i.id == "file.clearRecent").expect("clear item"); + assert_eq!(clear.label, "Clear Recent File List"); + assert!(!clear.enabled); } #[test]