Test: a press that takes no focus leaves the slide focused

This commit is contained in:
aiongg committed 2026-11-25 15:51:23 +00:00
1 parent 57a22b944f
commit 24bdb62f96
1 file changed
+16
@@ -85,6 +85,22 @@ fn a_press_on_the_slide_takes_the_keyboard_from_a_focused_button() {
assert_eq!(h.state().session.active().unwrap().doc.slides.len(), 2, "Enter adds a slide");
}
#[test]
fn after_a_press_on_a_pane_tab_selects_the_next_object() {
let mut h = harness();
let pos = egui::pos2(h.state().ui.thumbs_width / 2.0, 300.0);
h.hover_at(pos);
h.run_steps(1);
for pressed in [true, false] {
h.event(Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE });
h.run_steps(2);
}
assert!(h.state().slides_focused, "the press is in the thumbnail pane");
let first = h.state().session.active().unwrap().shapes()[0].id;
tab(&mut h);
assert_eq!((selected(&h), focused(&h)), (vec![first], Some(document_id())));
}
#[test]
fn after_a_dialog_closes_tab_selects_the_next_object() {
let mut h = harness();