mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-24 10:16:59 -06:00
#329: test that the Help menu works on the start screen
The Help menu's links were greyed out when no document was open, because UI commands outside app. and window. needed a document. The test checks every help.* UI command is enabled with an empty session while another UI command (view.rulers) stays disabled. Without the help. exemption it fails on "help.discord must work from the start screen".
This commit is contained in:
@@ -5642,4 +5642,17 @@ mod tests {
|
||||
assert!(texts.iter().any(|t| t == "Recent files"), "{texts:?}");
|
||||
assert!(texts.iter().any(|t| t == "gone"), "the card names it without `.designcraft`: {texts:?}");
|
||||
}
|
||||
|
||||
// Regression test for #329: on the start screen (no document) the Help menu's links were greyed out.
|
||||
#[test]
|
||||
fn help_links_are_enabled_without_a_document() {
|
||||
let app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
|
||||
assert!(app.session.active().is_none());
|
||||
let ids: Vec<&str> = UI_COMMANDS.iter().map(|c| c.0).filter(|id| id.starts_with("help.")).collect();
|
||||
assert!(ids.contains(&"help.discord") && ids.contains(&"help.github"), "{ids:?}");
|
||||
for id in ids {
|
||||
assert!(menu_enabled(&app, id), "{id} must work from the start screen");
|
||||
}
|
||||
assert!(!menu_enabled(&app, "view.rulers"), "other UI commands still need a document");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user