in src/components/alignment.rs [260:285]
fn test_align_top() {
let mut state = State::new();
let component = Aligned::new(
Box::new(Echo::<Msg>::new(false)),
HorizontalAlignmentKind::Left(false),
VerticalAlignmentKind::Top,
);
let original = vec![
vec!["hello world"].try_into().unwrap(), // 11 chars
vec!["pretty normal testsss"].try_into().unwrap(), // 21 chars
vec!["shorts"].try_into().unwrap(), // 6 chars
];
let msg = Msg(original);
state.insert(&msg);
let dimensions = Dimensions::new(20, 20);
let actual = component
.draw(&state, dimensions, DrawMode::Normal)
.unwrap();
let expected = vec![
vec!["hello world"].try_into().unwrap(),
vec!["pretty normal testss"].try_into().unwrap(),
vec!["shorts"].try_into().unwrap(),
];
assert_eq!(actual, expected);
}