mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Cover both Actions layouts in the docking menu test
This commit is contained in:
1 parent
6c51213379
commit
e6dbd17d58
1 file changed
+24
-15
@@ -744,23 +744,32 @@ fn floated_color_panel_menu_picks_the_mode() {
|
||||
assert_eq!(h.state().ui.color_panel.mode, crate::state::ColorPanelMode::RgbSliders);
|
||||
}
|
||||
|
||||
/// Docked Actions menus expose each layout's import/export commands.
|
||||
#[test]
|
||||
fn actions_panel_menu_includes_load_and_save_actions() {
|
||||
let mut ready = false;
|
||||
let mut menu = Harness::builder().build_ui_state(
|
||||
move |ui, app: &mut PhotocraftApp| {
|
||||
if !ready {
|
||||
PhotocraftApp::setup_context(ui.ctx(), crate::theme::ThemeKind::ProMedium);
|
||||
ready = true;
|
||||
}
|
||||
panel_menu(app, ui, "actions");
|
||||
},
|
||||
self::app(),
|
||||
);
|
||||
menu.run_steps(2);
|
||||
assert!(menu.query_all_by_label("Load Actions…").count() > 0);
|
||||
assert!(menu.query_all_by_label("Save Actions…").count() > 0);
|
||||
assert!(menu.query_all_by_label("New Action…").count() > 0);
|
||||
use crate::state::ActionsLayout;
|
||||
for (layout, load, save) in [(ActionsLayout::Classic, "Load Actions…", "Save Actions…"), (ActionsLayout::Modern, "Import Actions…", "Export Action…")]
|
||||
{
|
||||
let mut app = self::app();
|
||||
app.ui.actions_layout = layout;
|
||||
let mut ready = false;
|
||||
let mut menu = Harness::builder().build_ui_state(
|
||||
move |ui, app: &mut PhotocraftApp| {
|
||||
if !ready {
|
||||
PhotocraftApp::setup_context(ui.ctx(), crate::theme::ThemeKind::ProMedium);
|
||||
ready = true;
|
||||
}
|
||||
panel_menu(app, ui, "actions");
|
||||
},
|
||||
app,
|
||||
);
|
||||
menu.run_steps(2);
|
||||
assert!(menu.query_all_by_label(load).count() > 0);
|
||||
assert!(menu.query_all_by_label(save).count() > 0);
|
||||
if layout == ActionsLayout::Classic {
|
||||
assert!(menu.query_all_by_label("New Action…").count() > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user