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 <[email protected]>
This commit is contained in:
Trevor BrownandClaude Fable 5.1 committed 2026-11-05 08:46:31 -05:00
1 parent d1779bd1a1
commit ef13c81f4e
1 file changed
+6
@@ -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]