mirror of
https://github.com/storytold/deckcraft.git
synced 2026-12-01 18:23:52 -06:00
Test: the title bar's Home is on while Home is open
Guards the framework fix that marks a checked bar item's part on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2d7711a468
commit
af96347587
@@ -277,6 +277,28 @@ fn change_picture_replaces_the_selected_picture() {
|
||||
}
|
||||
}
|
||||
|
||||
/// The title bar's Home button shows on while Home (the File view) is open over a presentation, and off once it is
|
||||
/// left.
|
||||
#[test]
|
||||
fn the_title_bars_home_button_is_on_while_home_is_open() {
|
||||
use egui::accesskit::Toggled;
|
||||
use egui_kittest::kittest::{NodeT, Queryable};
|
||||
let mut h = crate::test_harness::harness(Session::with_new(), Services::default());
|
||||
h.run_steps(2);
|
||||
// The title bar's item, not the File view's Home page in its side menu.
|
||||
let in_title_bar = |node: &egui_kittest::Node<'_>| node.accesskit_node().bounding_box().is_some_and(|bounds| bounds.y1 <= 44.0);
|
||||
let home_on = |h: &egui_kittest::Harness<'_, SlideApp>| {
|
||||
let homes: Vec<_> = h.query_all_by(|node| node.label().is_some_and(|label| label.starts_with("Home"))).filter(in_title_bar).collect();
|
||||
assert!(!homes.is_empty(), "the title bar has a Home item");
|
||||
homes.iter().any(|node| node.accesskit_node().toggled() == Some(Toggled::True))
|
||||
};
|
||||
assert!(!home_on(&h), "Home is off over the slides");
|
||||
h.state_mut().run("app.home", json!({})).unwrap();
|
||||
h.run_steps(2);
|
||||
assert!(h.state().backstage_open());
|
||||
assert!(home_on(&h), "Home is on while the File view is open");
|
||||
}
|
||||
|
||||
/// #17: Home created a new blank presentation instead of going to the start screen.
|
||||
#[test]
|
||||
fn home_shows_the_start_screen_over_the_open_presentation() {
|
||||
|
||||
Reference in New Issue
Block a user