use of com.vaadin.flow.internal.nodefeature.TemplateMap in project flow by vaadin.
the class TemplateElementStateProviderTest method clearChildSlot_resetChild.
public void clearChildSlot_resetChild() {
Element parent = createElement("<div>@child@</div>");
Element child = ElementFactory.createSpan("child");
TemplateMap templateMap = parent.getNode().getFeature(TemplateMap.class);
templateMap.setChild(child.getNode());
Assert.assertEquals(1, parent.getChildCount());
templateMap.setChild(null);
Assert.assertEquals(0, parent.getChildCount());
Assert.assertEquals(0, parent.getChildren().count());
Assert.assertNull(child.getParent());
}
Aggregations