Lay out mounted overlays before asserting their rendered cues
This commit is contained in:
@@ -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!(
|
||||
|
||||
@@ -1117,6 +1117,16 @@ mod paint_tests {
|
||||
let mut messages = vec![];
|
||||
for active in 0..2 {
|
||||
let mut ui = UserInterface::build(view(&chooser, anchor), size, cache, &mut renderer);
|
||||
// Every controlled rebuild starts without a retained overlay layout.
|
||||
// Run the normal update pass before observing the rendered popup.
|
||||
let _ = ui.update(
|
||||
&[],
|
||||
cursor,
|
||||
&mut renderer,
|
||||
&mut iced::advanced::clipboard::Null,
|
||||
&mut messages,
|
||||
);
|
||||
assert!(messages.is_empty(), "layout cannot browse or choose");
|
||||
ui.draw(&mut renderer, &theme, &paint_style, cursor);
|
||||
let pixels = Headless::screenshot(&mut renderer, Size::new(480, 420), 1., Color::WHITE);
|
||||
for index in 0..3 {
|
||||
|
||||
Reference in New Issue
Block a user