Discover Table compatibility and declared Row alignment
This commit is contained in:
+50
-2
@@ -98,7 +98,7 @@ public final class PreviewChecks {
|
||||
String full = new String(in.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8);
|
||||
var details = BindingDiscovery.inspect(full, "rank", "both", "rankInput", "text", loader);
|
||||
check(
|
||||
details.problems().isEmpty(),
|
||||
details.problems().stream().allMatch(p -> p.severity().equals("INFO")),
|
||||
"Valid converter binding rejected: " + details.problems());
|
||||
for (var expected :
|
||||
java.util.Map.of(
|
||||
@@ -203,7 +203,55 @@ public final class PreviewChecks {
|
||||
repeat.panes().stream()
|
||||
.anyMatch(c -> c.name().equals("visits") && c.status().equals("COMPATIBLE")),
|
||||
"Repeat pane absent");
|
||||
check(repeat.problems().isEmpty(), "Valid Repeat rejected: " + repeat.problems());
|
||||
check(
|
||||
repeat.problems().stream().allMatch(p -> p.severity().equals("INFO")),
|
||||
"Valid Repeat/Table rejected: " + repeat.problems());
|
||||
check(
|
||||
repeat.tableCollections().stream()
|
||||
.anyMatch(c -> c.name().equals("visits") && c.status().equals("COMPATIBLE")),
|
||||
"Table collection absent");
|
||||
check(
|
||||
repeat.tableRows().stream()
|
||||
.anyMatch(
|
||||
c ->
|
||||
c.name().equals("fixture.components.VisitRow")
|
||||
&& c.status().equals("COMPATIBLE")),
|
||||
"Table Row absent");
|
||||
check(
|
||||
repeat.tableColumns().stream()
|
||||
.anyMatch(c -> c.name().equals("street") && c.status().equals("COMPATIBLE")),
|
||||
"Table Attribute absent");
|
||||
check(
|
||||
repeat.problems().stream()
|
||||
.anyMatch(p -> p.property().equals("alignment") && p.severity().equals("INFO")),
|
||||
"Row alignment not discovered");
|
||||
var wrongColumn =
|
||||
BindingDiscovery.inspect(
|
||||
full.replace("attribute=\"street\"", "attribute=\"missing\""),
|
||||
"visits",
|
||||
"view",
|
||||
loader);
|
||||
check(
|
||||
wrongColumn.problems().stream()
|
||||
.anyMatch(p -> p.property().equals("columns") && p.severity().equals("ERROR")),
|
||||
"Missing Column Attribute accepted");
|
||||
check(
|
||||
wrongColumn.problems().stream()
|
||||
.anyMatch(
|
||||
p -> p.property().equals("alignment") && p.message().contains("mismatch")),
|
||||
"Column/Row mismatch not found");
|
||||
var wrongRow =
|
||||
BindingDiscovery.inspect(
|
||||
full.replace(
|
||||
"row=\"fixture.components.VisitRow\"",
|
||||
"row=\"fixture.components.WrongRepeatCard\""),
|
||||
"visits",
|
||||
"view",
|
||||
loader);
|
||||
check(
|
||||
wrongRow.problems().stream()
|
||||
.anyMatch(p -> p.property().equals("row") && p.severity().equals("ERROR")),
|
||||
"Wrong Row Model accepted");
|
||||
var bad =
|
||||
BindingDiscovery.inspect(
|
||||
full.replace(
|
||||
|
||||
Reference in New Issue
Block a user