Search in sources :

Example 1 with ShadowRootStateProvider

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

the class ShadowRootStateProviderTest method createShadowRootNode_originalNodeIsInitialized.

@Test
public void createShadowRootNode_originalNodeIsInitialized() {
    ShadowRootStateProvider provider = ShadowRootStateProvider.get();
    StateNode node = new StateNode(ShadowRootData.class);
    StateNode shadowRoot = provider.createShadowRootNode(node);
    Assert.assertEquals(shadowRoot, node.getFeature(ShadowRootData.class).getShadowRoot());
}
Also used : ShadowRootStateProvider(com.vaadin.flow.dom.impl.ShadowRootStateProvider) StateNode(com.vaadin.flow.internal.StateNode) Test(org.junit.Test)

Example 2 with ShadowRootStateProvider

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

the class ShadowRootStateProviderTest method doesNotSupportEmptyNode.

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

Example 3 with ShadowRootStateProvider

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

the class ShadowRootStateProviderTest method getParent_parentIsHostElement.

@Test
public void getParent_parentIsHostElement() {
    ShadowRootStateProvider provider = ShadowRootStateProvider.get();
    StateNode node = new StateNode(ShadowRootData.class);
    StateNode shadowRoot = provider.createShadowRootNode(node);
    Assert.assertEquals(node, shadowRoot.getParent());
}
Also used : ShadowRootStateProvider(com.vaadin.flow.dom.impl.ShadowRootStateProvider) StateNode(com.vaadin.flow.internal.StateNode) Test(org.junit.Test)

Example 4 with ShadowRootStateProvider

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

the class ShadowRootStateProviderTest method supportsSelfCreatedNode.

@Test
public void supportsSelfCreatedNode() {
    ShadowRootStateProvider provider = ShadowRootStateProvider.get();
    StateNode node = new StateNode(ShadowRootData.class);
    StateNode shadowRoot = provider.createShadowRootNode(node);
    Assert.assertTrue(provider.supports(shadowRoot));
}
Also used : ShadowRootStateProvider(com.vaadin.flow.dom.impl.ShadowRootStateProvider) StateNode(com.vaadin.flow.internal.StateNode) Test(org.junit.Test)

Aggregations

ShadowRootStateProvider (com.vaadin.flow.dom.impl.ShadowRootStateProvider)4 StateNode (com.vaadin.flow.internal.StateNode)4 Test (org.junit.Test)4