use of com.vaadin.flow.internal.StateNode in project flow by vaadin.
the class StateNodeNodeListTest method testIndexOf.
@Test
public void testIndexOf() {
StateNode one = StateNodeTest.createEmptyNode("one");
StateNode two = StateNodeTest.createEmptyNode("two");
StateNode three = StateNodeTest.createEmptyNode("three");
nodeList.add(one);
nodeList.add(two);
Assert.assertEquals(0, nodeList.indexOf(one));
Assert.assertEquals(1, nodeList.indexOf(two));
Assert.assertEquals(-1, nodeList.indexOf(three));
}
use of com.vaadin.flow.internal.StateNode in project flow by vaadin.
the class VisibilityDataTest method setVisible.
@Test
public void setVisible() {
StateNode node = new StateNode(ElementData.class);
ElementData data = node.getFeature(ElementData.class);
Assert.assertNull(data.get(NodeProperties.VISIBLE));
Assert.assertTrue(data.isVisible());
data.put(NodeProperties.VISIBLE, true);
Assert.assertTrue(data.isVisible());
data.put(NodeProperties.VISIBLE, false);
Assert.assertFalse(data.isVisible());
}
use of com.vaadin.flow.internal.StateNode in project flow by vaadin.
the class BasicElementStateProviderTest method doesNotSupportEmptyNode.
@Test
public void doesNotSupportEmptyNode() {
BasicElementStateProvider provider = BasicElementStateProvider.get();
Assert.assertFalse(provider.supports(new StateNode()));
}
use of com.vaadin.flow.internal.StateNode in project flow by vaadin.
the class BasicElementStateProviderTest method supportsSelfCreatedNode.
@Test
public void supportsSelfCreatedNode() {
BasicElementStateProvider provider = BasicElementStateProvider.get();
StateNode node = BasicElementStateProvider.createStateNode("foo");
Assert.assertTrue(provider.supports(node));
}
use of com.vaadin.flow.internal.StateNode in project flow by vaadin.
the class BasicElementStateProviderTest method supportsUIRootNode.
@Test
public void supportsUIRootNode() {
BasicElementStateProvider provider = BasicElementStateProvider.get();
UI ui = new UI() {
@Override
protected void init(VaadinRequest request) {
}
};
StateNode rootNode = ui.getInternals().getStateTree().getRootNode();
Assert.assertTrue(provider.supports(rootNode));
}
Aggregations