chore: improve markdown component
This commit is contained in:
@@ -488,6 +488,31 @@ fn blocks_render_virtualized_and_scroll_to_a_block() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn indented_blocks_render_inside_the_frame_text_style() {
|
||||
let (_cx, mut visual, state) =
|
||||
view_window("- top task\n - nested task\n\n1. outer\n 1. inner\n");
|
||||
|
||||
let ids = _cx.update(|cx| [0, 1, 2, 3].map(|index| block_id(&state, cx, index)));
|
||||
let mut height = |id: &'static str| {
|
||||
visual
|
||||
.debug_bounds(id)
|
||||
.map(|bounds| bounds.size.height)
|
||||
.expect("the block renders")
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
height(ids[0]),
|
||||
height(ids[1]),
|
||||
"the nested task must keep the frame's text metrics"
|
||||
);
|
||||
assert_eq!(
|
||||
height(ids[2]),
|
||||
height(ids[3]),
|
||||
"the nested ordered item must keep the frame's text metrics"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn clicking_a_link_opens_its_destination() {
|
||||
let (_cx, mut visual, state) = view_window("[click me](https://example.com/welcome)");
|
||||
|
||||
Reference in New Issue
Block a user