Align native container children within allocated main-axis bounds
Verify Tessera GUI / verify (push) Failing after 7m55s
Verify Tessera GUI / verify (push) Failing after 7m55s
This commit is contained in:
@@ -3889,6 +3889,52 @@ page.render(block)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn main_alignment_updates_live_geometry_without_changing_sizes() {
|
||||
let (mut session, initial) = ReplSession::load(r#"
|
||||
class Wide: Row {
|
||||
function measure(self: Wide, mount: Mount, constraints: Constraints): MeasureResult { return MeasureResult(300, 60) }
|
||||
}
|
||||
first = RectBlock(20, 20)
|
||||
second = RectBlock(40, 40)
|
||||
row = Wide(10, 10, first, second)
|
||||
page = Page()
|
||||
page.render(row)
|
||||
"#, "app.main", 264, 1).unwrap();
|
||||
initial.validate().unwrap();
|
||||
for (mode, first, second) in [
|
||||
("start", "10", "40"),
|
||||
("center", "115", "145"),
|
||||
("end", "220", "250"),
|
||||
("space-between", "10", "250"),
|
||||
] {
|
||||
session
|
||||
.execute(&format!("row.mainAlign = \"{mode}\""), "app.main")
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
session
|
||||
.execute("first.mounts().at(0).bounds().x", "app.main")
|
||||
.unwrap()
|
||||
.value,
|
||||
first
|
||||
);
|
||||
assert_eq!(
|
||||
session
|
||||
.execute("second.mounts().at(0).bounds().x", "app.main")
|
||||
.unwrap()
|
||||
.value,
|
||||
second
|
||||
);
|
||||
assert_eq!(
|
||||
session
|
||||
.execute("first.mounts().at(0).bounds().width", "app.main")
|
||||
.unwrap()
|
||||
.value,
|
||||
"20"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scroll_axes_wrap_shared_text_and_clamp_only_the_enabled_offsets() {
|
||||
let (mut session, initial) = ReplSession::load(
|
||||
|
||||
Reference in New Issue
Block a user