From f5ea2d2dfb1dca2b5c95ea0bd09e0abd2beaa091 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 23 Nov 2026 21:52:58 +0700 Subject: [PATCH] Tests: the panel harness finds a control by its label alone again: Fixture::by_label passes over a caption link to the field it captions (craft-libs b72fc4200) --- crates/ui-egui/src/tests/panel_harness.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/tests/panel_harness.rs b/crates/ui-egui/src/tests/panel_harness.rs index 66ea034193..0949ef8c80 100644 --- a/crates/ui-egui/src/tests/panel_harness.rs +++ b/crates/ui-egui/src/tests/panel_harness.rs @@ -88,16 +88,9 @@ impl Panel { tree.keys().into_iter().filter_map(|key| tree.name_of(key)).map(str::to_owned).collect() } - /// The control named `name` in the latest frame. A caption link takes the name of the number field it captions - /// (the Control bar's X, Y, W and H): the field is the control. + /// The control named `name` in the latest frame. fn look(&self, name: &str) -> Target { - use craft::ui::contract::Role; - let found = self.fixture.by_label(name).unwrap_or_else(|| panic!("no {name:?} in {:?}", self.names())); - let tree = self.fixture.tree(); - if tree.role_of(found.node) != Some(Role::LINK) { - return found; - } - self.fixture.by_role(Role::SPIN_BUTTON).into_iter().find(|t| tree.name_of(t.node) == Some(name)).unwrap_or(found) + self.fixture.by_label(name).unwrap_or_else(|| panic!("no {name:?} in {:?}", self.names())) } /// A fresh frame, then the control named `name`.