use crate::test_support::window::{conv, seated};
#[test]
fn the_panel_grounds_tile_the_window_with_no_gap_for_the_clear_to_show_through() {
for width in [1400.0_f32, 1000.0, 900.0, 800.0, 700.0, 600.0] {
let mut model = seated();
model.convs = vec![conv(
"id",
"a conversation with a name long enough to overflow",
)];
let ctx = egui::Context::default();
let painted = ctx.run(
crate::paint_probe::frame::screen_sized(width, 600.0),
|ctx| crate::ui::render(ctx, &mut model),
);
let mut grounds: Vec<egui::Rect> = crate::paint_probe::fills_of(&painted)
.into_iter()
.filter(|(rect, ink)| rect.height() > 300.0 && ink.a() > 250)
.map(|(rect, _)| rect)
.collect();
grounds.sort_by(|a, b| a.min.x.total_cmp(&b.min.x));
let mut edge = 0.0_f32;
for ground in &grounds {
assert!(
(ground.min.x - edge).abs() < 0.5,
"at {width} points a strip of x{edge:.1}..{:.1} is painted by no panel: {grounds:?}",
ground.min.x
);
edge = ground.max.x;
}
assert!(
(edge - width).abs() < 0.5,
"at {width} points the grounds stop at {edge:.1}: {grounds:?}"
);
}
}