diff --git a/src/runtime/endor_host/tests.rs b/src/runtime/endor_host/tests.rs index fbd93c4..52d41b7 100644 --- a/src/runtime/endor_host/tests.rs +++ b/src/runtime/endor_host/tests.rs @@ -207,8 +207,10 @@ page.render(Column(0,8,Column(0,8,paragraph,tail),Column(50,8,paragraph))) }) .collect(); assert_eq!(commands.len(), 2); - assert_eq!(commands[0][0], 240.0); - assert_eq!(commands[1][0], 140.0); + // The 240px window reserves 56px for the rail and 8px for its inset. + // The second occurrence additionally has 50px padding on each side. + assert_eq!(commands[0][0], 176.0); + assert_eq!(commands[1][0], 76.0); assert!(commands[1][1] > commands[0][1]); let tail = initial .frame @@ -236,6 +238,20 @@ page.render(Column(0,8,Column(0,8,paragraph,tail),Column(50,8,paragraph))) .map(|m| m.id) .collect::>() ); + let widths: Vec<_> = resized + .frame + .commands + .iter() + .filter_map(|command| match command { + RenderCommand::Text { + value, + wrap_bounds: Some(bounds), + .. + } if value == &text => Some(bounds[0]), + _ => None, + }) + .collect(); + assert_eq!(widths, [336.0, 236.0]); let heights: Vec<_> = resized .frame .commands @@ -1758,6 +1774,15 @@ fn viewport_resize_changes_constraints_and_preserves_mount_identity_without_sour }), ) .unwrap(); + // Page content excludes the 56px rail, 8px inset and 24px root padding + // on each side, both initially and after resizing the outer window. + assert!( + initial + .frame + .mounts + .iter() + .any(|mount| mount.width == 688.0 && mount.height == 24.0) + ); let ids: Vec<_> = initial.frame.mounts.iter().map(|mount| mount.id).collect(); let document = session .resize(Some(crate::layout::Size { @@ -1780,7 +1805,7 @@ fn viewport_resize_changes_constraints_and_preserves_mount_identity_without_sour .frame .mounts .iter() - .any(|mount| mount.width == 312.0 && mount.height == 24.0) + .any(|mount| mount.width == 248.0 && mount.height == 24.0) ); assert_eq!(session.inputs, 0); assert!(