Validate grid width bounds and qualify Archiver window and document states in IntelliJ

This commit is contained in:
2026-11-25 12:08:18 +01:00
parent 2df25985ce
commit ff6ba0a745
12 changed files with 429 additions and 65 deletions
@@ -130,10 +130,67 @@ public final class MediaLayoutGridWorkflowProbe extends DeclarationWorkflowProbe
interactive("archive-window-media", "media");
}
private void columnWidths() throws Exception {
select("DataGridColumn", "path");
for (var pair : List.of(List.of("minimumWidth", "300"), List.of("maximumWidth", "100"))) {
String before = source();
combo("declaration-property", pair.getFirst());
fx(
() -> {
((ComboBox<?>) pane.lookup("#declaration-value")).getEditor().setText(pair.getLast());
return null;
});
click(pane, "Apply setting");
var message = fx(() -> ((Label) pane.lookup("#declaration-message")).getText());
if (!source().equals(before)
|| !message.contains(pair.getFirst() + "=" + pair.getLast())
|| !message.contains("width=230"))
throw new AssertionError("Invalid width edit: " + message);
if (!fx(
() ->
((javafx.scene.image.ImageView) pane.lookup("#full-preview-image")).getImage() != null
&& ((Label) pane.lookup("#preview-state")).getText().contains("Beispieldateien")))
throw new AssertionError("Lost the valid example preview");
step("Rejected · valid FXML and example preview retained · " + message);
}
applySetting("minimumWidth", "150");
applySetting("maximumWidth", "300");
applySetting("width", "240");
for (String field : List.of("width", "minimumWidth", "maximumWidth")) {
String before = source();
combo("declaration-property", field);
fx(
() -> {
((ComboBox<?>) pane.lookup("#declaration-value")).getEditor().clear();
return null;
});
click(pane, "Apply setting");
await(() -> !source().equals(before));
String reset = source();
history(before, reset);
click(pane, "Undo");
await(() -> source().equals(before));
fx(pane::flush).toCompletableFuture().get();
}
applySetting("width", "230");
}
private void folder() throws Exception {
open("FolderTab");
build("archive-folder");
choose("preview-example", "archive-folder");
await(
() ->
fx(
() ->
((javafx.scene.image.ImageView) pane.lookup("#full-preview-image")).getImage()
!= null
&& ((Label) pane.lookup("#preview-state"))
.getText()
.contains("Beispieldateien")));
inspector(true);
var original = declarations();
columnWidths();
select("DataGrid", "grid");
applySetting("setupId", "archiver-pruefung");
applySetting("setupVersion", "2");