use of com.vaadin.flow.internal.nodefeature.VirtualChildrenList in project flow by vaadin.
the class PolymerTemplateTest method attachExistingElement_elementIsCreatedAndSetAsVirtualChild.
@Test
public void attachExistingElement_elementIsCreatedAndSetAsVirtualChild() {
IdElementTemplate template = new IdElementTemplate();
VirtualChildrenList feature = template.getStateNode().getFeature(VirtualChildrenList.class);
List<StateNode> templateNodes = new ArrayList<>();
feature.forEachChild(templateNodes::add);
assertEquals(1, templateNodes.size());
StateNode child = templateNodes.get(0);
String tag = child.getFeature(ElementData.class).getTag();
assertEquals("label", tag);
assertNotNull(template.label);
assertEquals(child, template.label.getNode());
assertElementData(child, NodeProperties.INJECT_BY_ID, "labelId");
}
Aggregations