Lay out mounted overlays before asserting their rendered cues

This commit is contained in:
2026-09-12 17:53:09 -07:00
parent a357b22778
commit e44f07565c
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -1215,6 +1215,16 @@ mod tests {
"moving the target must not invoke an action"
);
}
// Building an Iced UI does not lay out its overlay. The normal
// update pass must initialize it before draw can paint the menu.
let _ = ui.update(
&[],
cursor,
&mut renderer,
&mut iced::advanced::clipboard::Null,
&mut messages,
);
assert!(messages.is_empty(), "layout cannot invoke an action");
ui.draw(&mut renderer, &theme, &paint_style, cursor);
let pixels = Headless::screenshot(&mut renderer, Size::new(480, 420), 1., Color::WHITE);
assert!(