use of com.vaadin.flow.internal.nodefeature.ClientDelegateHandlers in project flow by vaadin.
the class ClientDelegteHandlersTest method eventHandlersUnrelatedToAttach.
@Test
public void eventHandlersUnrelatedToAttach() {
StateNode stateNode = new StateNode(ComponentMapping.class, ClientDelegateHandlers.class);
stateNode.getFeature(ComponentMapping.class).setComponent(new Template1());
ClientDelegateHandlers feature = stateNode.getFeature(ClientDelegateHandlers.class);
Assert.assertEquals(1, feature.size());
}
use of com.vaadin.flow.internal.nodefeature.ClientDelegateHandlers in project flow by vaadin.
the class ClientDelegteHandlersTest method nonTemplateComponentWithoutEventHandler.
@Test
public void nonTemplateComponentWithoutEventHandler() {
UI ui = new UI();
NonTemplateComponentWithoutEventHandler component = new NonTemplateComponentWithoutEventHandler();
ui.add(component);
ClientDelegateHandlers feature = component.getElement().getNode().getFeature(ClientDelegateHandlers.class);
assertListFeature(feature);
}
use of com.vaadin.flow.internal.nodefeature.ClientDelegateHandlers in project flow by vaadin.
the class ClientDelegteHandlersTest method attach_handlersContainsOnlyOneTemplateMethod.
@Test
public void attach_handlersContainsOnlyOneTemplateMethod() {
UI ui = new UI();
AngularTemplate template = new ChildTemplateWithOverriddenMethod();
ui.add(template);
ClientDelegateHandlers feature = template.getElement().getNode().getFeature(ClientDelegateHandlers.class);
Assert.assertEquals(1, feature.size());
Assert.assertEquals(getDeclaredMethods(ChildTemplateWithOverriddenMethod.class).findFirst().get(), feature.get(0));
}
Aggregations