Keep form edits anchored across native autosaves
This commit is contained in:
@@ -122,6 +122,21 @@ class FormDocumentTest {
|
||||
assertThrows(IllegalArgumentException.class, () -> set("autoCompleteTextField", "width", "20"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void nativeSaveBetweenPaletteSelectionAndApply() throws Exception {
|
||||
source = source.replace("<GridPane/>", "<GridPane> \n</GridPane>");
|
||||
var edit = doc().add("Label", slot("", "children"), 0);
|
||||
var saved = source.replace("> \n", ">\n");
|
||||
var changes = FormDocument.forCurrentText(edit, saved);
|
||||
var result =
|
||||
new EditBatch(2, "Insert Label", changes)
|
||||
.applyTo(new DocumentSnapshot(URI.create("file:///test.fxml"), 2, saved, true, false));
|
||||
assertTrue(new FormDocument(result).items.stream().anyMatch(i -> i.id().equals("label")));
|
||||
assertThrows(
|
||||
ConcurrentModificationException.class,
|
||||
() -> FormDocument.forCurrentText(edit, saved.replace("GridPane", "VBox")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void implicitToolbarChildrenStayInOneList() throws Exception {
|
||||
source =
|
||||
|
||||
Reference in New Issue
Block a user