use of com.vaadin.client.Registry in project flow by vaadin.
the class ExecuteJavaScriptProcessorTest method isBound_hasElementHasFeatureAndBoundAndUnboundParent_notBound.
@Test
public void isBound_hasElementHasFeatureAndBoundAndUnboundParent_notBound() {
TestJsProcessor processor = new TestJsProcessor();
Registry registry = processor.getRegistry();
StateNode node = new StateNode(37, registry.getStateTree());
node.getMap(NodeFeatures.VISIBILITY_DATA).getProperty(NodeProperties.VISIBILITY_BOUND_PROPERTY).setValue(true);
StateNode parent = new StateNode(43, registry.getStateTree());
node.setParent(parent);
// emulate binding
JsElement element = new JsElement() {
};
node.setDomNode(element);
Assert.assertFalse(processor.isBound(node));
}
use of com.vaadin.client.Registry in project flow by vaadin.
the class ExecuteJavaScriptProcessorTest method execute_nodeParameterIsNotVirtualChild.
@Test
public void execute_nodeParameterIsNotVirtualChild() {
CollectingExecuteJavaScriptProcessor processor = new CollectingExecuteJavaScriptProcessor();
Registry registry = processor.getRegistry();
StateNode node = new StateNode(12, registry.getStateTree());
registry.getStateTree().registerNode(node);
JsonArray json = JsonUtils.createArray(Json.create(JsonCodec.NODE_TYPE), Json.create(node.getId()));
JsonArray invocation = Stream.of(json, Json.create("$0")).collect(JsonUtils.asArray());
processor.execute(JsonUtils.createArray(invocation));
// The invocation has been executed
Assert.assertEquals(1, processor.nodeParametersList.size());
}
use of com.vaadin.client.Registry in project flow by vaadin.
the class ExecuteJavaScriptProcessorTest method isBound_hasElementHasNoFeatureAndUnboundParent_notBound.
@Test
public void isBound_hasElementHasNoFeatureAndUnboundParent_notBound() {
TestJsProcessor processor = new TestJsProcessor();
Registry registry = processor.getRegistry();
StateNode node = new StateNode(37, registry.getStateTree());
StateNode parent = new StateNode(43, registry.getStateTree());
node.setParent(parent);
// emulate binding
JsElement element = new JsElement() {
};
node.setDomNode(element);
Assert.assertFalse(processor.isBound(node));
}
use of com.vaadin.client.Registry in project flow by vaadin.
the class ExecuteJavaScriptProcessorTest method isBound_hasElementHasFeatureAndNotBound_notBound.
@Test
public void isBound_hasElementHasFeatureAndNotBound_notBound() {
TestJsProcessor processor = new TestJsProcessor();
Registry registry = processor.getRegistry();
StateNode node = new StateNode(37, registry.getStateTree());
// emulate binding
JsElement element = new JsElement() {
};
node.setDomNode(element);
node.getMap(NodeFeatures.VISIBILITY_DATA).getProperty(NodeProperties.VISIBILITY_BOUND_PROPERTY).setValue(false);
Assert.assertFalse(processor.isBound(node));
}
use of com.vaadin.client.Registry in project flow by vaadin.
the class ExecuteJavaScriptProcessorTest method isBound_hasElementHasNoFeature_bound.
@Test
public void isBound_hasElementHasNoFeature_bound() {
TestJsProcessor processor = new TestJsProcessor();
Registry registry = processor.getRegistry();
StateNode node = new StateNode(37, registry.getStateTree());
// emulate binding
JsElement element = new JsElement() {
};
node.setDomNode(element);
Assert.assertTrue(processor.isBound(node));
}
Aggregations