Search in sources :

Example 1 with BasicElementStateProvider

use of com.vaadin.flow.dom.impl.BasicElementStateProvider 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));
}
Also used : StateNode(com.vaadin.flow.internal.StateNode) BasicElementStateProvider(com.vaadin.flow.dom.impl.BasicElementStateProvider) Test(org.junit.Test)

Example 2 with BasicElementStateProvider

use of com.vaadin.flow.dom.impl.BasicElementStateProvider in project flow by vaadin.

the class BasicElementStateProviderTest method doesNotSupportEmptyNode.

@Test
public void doesNotSupportEmptyNode() {
    BasicElementStateProvider provider = BasicElementStateProvider.get();
    Assert.assertFalse(provider.supports(new StateNode()));
}
Also used : StateNode(com.vaadin.flow.internal.StateNode) BasicElementStateProvider(com.vaadin.flow.dom.impl.BasicElementStateProvider) Test(org.junit.Test)

Example 3 with BasicElementStateProvider

use of com.vaadin.flow.dom.impl.BasicElementStateProvider 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));
}
Also used : UI(com.vaadin.flow.component.UI) StateNode(com.vaadin.flow.internal.StateNode) VaadinRequest(com.vaadin.flow.server.VaadinRequest) BasicElementStateProvider(com.vaadin.flow.dom.impl.BasicElementStateProvider) Test(org.junit.Test)

Aggregations

BasicElementStateProvider (com.vaadin.flow.dom.impl.BasicElementStateProvider)3 StateNode (com.vaadin.flow.internal.StateNode)3 Test (org.junit.Test)3 UI (com.vaadin.flow.component.UI)1 VaadinRequest (com.vaadin.flow.server.VaadinRequest)1