mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-24 10:09:01 -06:00
LRC-DEV-AUTOSYNC: separate UI fixture changes
Restore the original UI tests so this PR contains only the camera local-tone Auto Sync fix and its two engine regressions. Keep the independently prepared fixture correction in its separate review scope. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -116,7 +116,6 @@ fn hovering_another_title_switches_the_open_menu() {
|
||||
#[test]
|
||||
fn clicking_another_title_opens_it_in_one_click() {
|
||||
let mut h = app([1280.0, 703.0]);
|
||||
assert!(h.step_until(SETTLE, |h| widget(h, "menu:Edit").is_some()), "Edit menu title was not registered");
|
||||
go(&mut h, "ui.clickWidget", "menu:Edit");
|
||||
assert_eq!(open_menu(&h).as_deref(), Some("menu:Edit"));
|
||||
// move away from the titles first so only the click can be what switches
|
||||
|
||||
@@ -84,20 +84,8 @@ fn open_and_scan(h: &mut Headless, folder: &str) {
|
||||
// the rows above it hold one folder each and open by themselves
|
||||
let row = format!("source:libfolder:{folder}");
|
||||
assert!(h.step_until(T, |h| h.app.widgets.iter().any(|(w, _)| *w == row)), "no row {row}");
|
||||
let before = h.app.widgets.iter().find(|(w, _)| *w == row).map(|(_, r)| *r).unwrap_or_else(|| panic!("no row {row}"));
|
||||
let panel = h.app.widgets.iter().find(|(w, _)| w == "panel:left_panel").map(|(_, r)| *r).expect("left panel");
|
||||
// Off-screen rows are registered too. Bring this row into view before the real right-click.
|
||||
crate::tests_panels::scroll_sidebar(h, panel.center().y - before.center().y);
|
||||
let rect = h.app.widgets.iter().find(|(w, _)| *w == row).map(|(_, r)| *r).unwrap_or_else(|| panic!("no row {row}"));
|
||||
let panel = h.app.widgets.iter().find(|(w, _)| w == "panel:left_panel").map(|(_, r)| *r).expect("left panel");
|
||||
let visible = rect.intersect(panel);
|
||||
let c = visible.center();
|
||||
let drawn = h.app.widgets.iter().any(|(w, _)| *w == format!("label:libfolder:{folder}"));
|
||||
let clips: Vec<_> = h.view.shapes.iter().filter(|s| s.shape.visual_bounding_rect().intersects(rect)).map(|s| s.clip_rect).collect();
|
||||
eprintln!(
|
||||
"sync row geometry: before={before:?} row={rect:?} panel={panel:?} visible={visible:?} click={c:?} drawn={drawn} paint_clips={clips:?}"
|
||||
);
|
||||
assert!(drawn && visible.is_positive() && visible.height() >= rect.height() - 0.5, "folder row must be drawn and vertically in view");
|
||||
let c = rect.center();
|
||||
let r = h.request("ui.click", json!({"x": c.x, "y": c.y, "button": "right"}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.step();
|
||||
|
||||
Reference in New Issue
Block a user