mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 05:37:04 +00:00
DIAG prints: NumberField label click and MarginHandles drag in the suite
This commit is contained in:
@@ -18,8 +18,12 @@ const CENTRE: Point = Point::new(300.0, 400.0);
|
||||
const DRAG_THRESHOLDS: f32 = 12.0;
|
||||
|
||||
fn drag_left_edge(fixture: &mut Fixture) {
|
||||
let Some(target) = fixture.by_label("Left Margin") else { return };
|
||||
let Some(target) = fixture.by_label("Left Margin") else {
|
||||
eprintln!("DIAG drives: margin_handles_on_rulers: no node labelled Left Margin");
|
||||
return;
|
||||
};
|
||||
let travel = DRAG_THRESHOLDS * craft_ui::testing::input::slop(fixture.ctx());
|
||||
eprintln!("DIAG drives: margin_handles_on_rulers: dragging Left Margin by {travel}");
|
||||
fixture.drag(&target, Vec2::new(travel, 0.0));
|
||||
}
|
||||
|
||||
|
||||
@@ -149,6 +149,15 @@ fn declared_actions_are_handled(subject: &Subject) -> Result<(), String> {
|
||||
|| signature(fixture.tree()) != before
|
||||
|| fixture.focused() != focus;
|
||||
if !acted {
|
||||
eprintln!(
|
||||
"DIAG activation: {} {kind:?} on {:?} named {:?}: focus {focus:?} -> {:?}, outputs {}, disabled {:?}",
|
||||
story.name,
|
||||
fixture.tree().role_of(key),
|
||||
fixture.tree().name_of(key),
|
||||
fixture.focused(),
|
||||
outputs.len(),
|
||||
fixture.tree().data_of(key).map(|node| node.is_disabled()),
|
||||
);
|
||||
return Err(format!("{}: {kind:?} on {:?} did nothing", story.name, fixture.tree().role_of(key)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,6 +323,9 @@ fn runs_of(story: &Story, probe: &Probe, plan: Plan) -> Runs {
|
||||
continue;
|
||||
}
|
||||
if !changed {
|
||||
if story.name.starts_with("margin_handles") {
|
||||
eprintln!("DIAG drives: {} {name} changed nothing: edits {kinds:?}, lent {lent}, focus {:?}", story.name, fixture.focused());
|
||||
}
|
||||
unchanged_by.push(name);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user