M4: components test: check the hugging instance only when its text was measured (#1)
Without craft-fonts (CI) the overridden text keeps its size, so the old guard (`width > 0`) asserted a hug that could never happen and failed main's CI. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1608822632
commit
dd1fd439d4
|
|
@ -373,8 +373,11 @@ fn resized_instances_follow_constraints_and_auto_layout() {
|
|||
let ci = idv(&ex(&mut s, "instance.create", json!({"component": chip, "x": 300, "y": 600})));
|
||||
let w0 = node(&s, ci).width;
|
||||
let it = copy_of(&s, ci, t);
|
||||
let tw0 = node(&s, it).width;
|
||||
ex(&mut s, "text.set", json!({"id": it, "characters": "A much longer chip label"}));
|
||||
if figcraft_text::find_face("Inter", "Regular").is_some() || node(&s, it).width > 0.0 {
|
||||
// Without a measurable font (CI has no craft-fonts) the text keeps its size; only check the
|
||||
// hug when the text actually grew.
|
||||
if node(&s, it).width > tw0 {
|
||||
assert!(node(&s, ci).width > w0, "auto layout instance hugs its overridden text");
|
||||
}
|
||||
healthy(&s);
|
||||
|
|
|
|||
Loading…
Reference in New Issue