thing-core(tests): place blank/other below session overlay list in light-dismiss test
This commit is contained in:
parent
555e058fe6
commit
72765d05aa
1 changed files with 11 additions and 3 deletions
|
|
@ -1162,7 +1162,7 @@ fn session_overlay_skips_focus_order_hits_rows_without_blurring_and_light_dismis
|
|||
"root",
|
||||
None,
|
||||
Overflow::Visible,
|
||||
vec![select_control("pick", "choose"), button("other", "other", 160.0, 32.0), fixed("blank", 160.0, 64.0)],
|
||||
vec![select_control("pick", "choose"), fixed("blank", 160.0, 80.0), button("other", "other", 160.0, 32.0)],
|
||||
),
|
||||
vec![decl("choose", &[]), decl("other", &[])],
|
||||
);
|
||||
|
|
@ -1209,12 +1209,20 @@ fn session_overlay_skips_focus_order_hits_rows_without_blurring_and_light_dismis
|
|||
assert_eq!(commands_of(&rig.minted()), ["choose"], "{mode:?}");
|
||||
assert_eq!(rig.draft("pick"), Some(InputValue::Choice(ChoiceValue { value: "b".into() })), "{mode:?}");
|
||||
|
||||
// Re-open session: clicking outside (on blank background) light-dismisses and clears focus.
|
||||
// Re-open session: clicking outside (bottom of blank, below the overlay) light-dismisses and clears focus.
|
||||
rig.input.open_session(select_session("pick"));
|
||||
let blank = rig.rect("blank");
|
||||
rig.click(inside(blank));
|
||||
rig.click((blank.x + 0.5, blank.y + blank.h - 0.5));
|
||||
assert!(rig.input.session().is_none(), "{mode:?}");
|
||||
assert!(rig.input.focus().node().is_none(), "{mode:?}");
|
||||
|
||||
// Re-open session: clicking outside on another button light-dismisses and activates that button.
|
||||
rig.input.open_session(select_session("pick"));
|
||||
let other = rig.rect("other");
|
||||
rig.click((other.x + 0.5, other.y + other.h - 0.5));
|
||||
assert!(rig.input.session().is_none(), "{mode:?}");
|
||||
assert_eq!(rig.input.focus().node(), Some(&nid("other")), "{mode:?}");
|
||||
assert_eq!(commands_of(&rig.minted()), ["other"], "{mode:?}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue