Discover Repeat collections and compatible Components in both hosts

This commit is contained in:
2026-11-13 14:47:21 +01:00
parent 0300062fb6
commit 0d14ac14e0
28 changed files with 969 additions and 44 deletions
@@ -727,14 +727,105 @@ public final class ProjectionHostChecks {
java.nio.file.Path.of(document.snapshot().toCompletableFuture().get().document()))
.equals(changed),
"Repeat save changed source");
click(pane, "Validate Repeat bindings");
selectRepeat(pane, "otherVisits");
click(pane, "Discover / Validate Repeat");
await(
() ->
fx(
() ->
((Label) pane.lookup("#repeat-status"))
.getText()
.contains("Collection and Component compatibility")));
.contains("Compatibility uses declarations")));
await(() -> fx(() -> !((ComboBox<?>) pane.lookup("#repeat-components")).getItems().isEmpty()));
fx(
() -> {
var choices =
(ComboBox<de.neitzel.fxdesigner.protocol.BindingMetadata.RepeatOption>)
pane.lookup("#repeat-components");
check(
choices.getItems().stream()
.anyMatch(
c ->
c.name().equals("fixture.components.AddressForm")
&& c.status().equals("COMPATIBLE")),
"Compatible Component choice absent");
check(
choices.getItems().stream()
.anyMatch(
c ->
c.name().equals("fixture.components.WrongRepeatCard")
&& c.status().equals("INCOMPATIBLE")),
"Incompatible Component not explained");
var panes =
(ComboBox<de.neitzel.fxdesigner.protocol.BindingMetadata.RepeatOption>)
pane.lookup("#repeat-panes");
check(
panes.getItems().stream()
.anyMatch(c -> c.name().equals("action") && c.status().equals("INCOMPATIBLE")),
"Non-Pane target accepted");
check(
((TextField) pane.lookup("#repeat-component"))
.getText()
.equals("fixture.components.VisitRow"),
"Discovery replaced explicit Component");
var collections =
(ComboBox<de.neitzel.fxdesigner.protocol.BindingMetadata.RepeatOption>)
pane.lookup("#repeat-collections");
collections.setValue(
collections.getItems().stream()
.filter(c -> c.name().equals("visits"))
.findFirst()
.orElseThrow());
return null;
});
await(() -> fx(() -> !((ComboBox<?>) pane.lookup("#repeat-components")).getItems().isEmpty()));
check(documentText(document).equals(changed), "Repeat discovery changed source");
fx(
() -> {
var choices =
(ComboBox<de.neitzel.fxdesigner.protocol.BindingMetadata.RepeatOption>)
pane.lookup("#repeat-components");
choices.setValue(
choices.getItems().stream()
.filter(c -> c.name().equals("fixture.components.WrongRepeatCard"))
.findFirst()
.orElseThrow());
return null;
});
check(documentText(document).equals(changed), "Component choice applied without review");
click(pane, "Apply Repeat binding");
String mismatched =
changed.replace(
"component=\"fixture.components.VisitRow\"",
"component=\"fixture.components.WrongRepeatCard\"");
await(() -> documentText(document).equals(mismatched));
await(() -> fx(() -> source(pane).getText().equals(mismatched)));
document
.save(document.snapshot().toCompletableFuture().get().revision())
.toCompletableFuture()
.get();
click(pane, "Render drafts");
await(
() ->
fx(
() ->
((Label) pane.lookup("#repeat-status"))
.getText()
.contains("incompatible with Component Model")));
await(
() ->
fx(
() ->
pane.lookupAll(".label").stream()
.anyMatch(
n ->
n instanceof Label l
&& l.getText() != null
&& l.getText().startsWith("Preview blocked:"))));
repeatHistory(pane, document, changed, mismatched);
click(pane, "Undo");
await(() -> documentText(document).equals(changed));
await(() -> fx(() -> source(pane).getText().equals(changed)));
click(pane, "Render drafts");
await(
() ->
@@ -773,6 +864,7 @@ public final class ProjectionHostChecks {
click(pane, "Apply Repeat binding");
String invalid = replaced.replace("collection=\"visits\"/>", "collection=\"invalid path\"/>");
await(() -> documentText(document).equals(invalid));
await(() -> fx(() -> source(pane).getText().equals(invalid)));
document
.save(document.snapshot().toCompletableFuture().get().revision())
.toCompletableFuture()