use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class FormGeneratorDriverTest method testCreateContainers.
@Test
public void testCreateContainers() {
HTMLElement container = driver.createContainer();
verify(document).createElement(eq(CONTAINER_TAG));
Assert.assertNotNull(container);
verify(container).setClassName(ColumnSize.MD_12.getCssName());
HTMLElement row = driver.createRow(new LayoutRow());
verify(document, times(2)).createElement(eq(CONTAINER_TAG));
Assert.assertNotNull(row);
verify(row).setClassName(eq(ROW_CLASS));
LayoutColumn layoutColumn = new LayoutColumn("12");
HTMLElement column = driver.createColumn(layoutColumn);
Assert.assertNotNull(column);
verify(column).setClassName(ColumnSizeBuilder.buildColumnSize(12));
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class FormGeneratorDriverTest method testGetComponentPart.
@Test
public void testGetComponentPart() {
testCreateComponent();
HTMLElement column = mock(HTMLElement.class);
LayoutComponent layoutComponent = new LayoutComponent(FieldLayoutComponent.class.getName());
Optional<IsWidget> result = driver.getComponentPart(column, layoutComponent, "");
Assert.assertTrue(result.isPresent());
verify(wrapperWidgetUtil, times(3)).getWidget(same(driver), any(HTMLElement.class));
FieldLayoutComponent fieldLayoutComponent = driver.getLayoutFields().get(0);
verify(fieldLayoutComponent).getContentPart(eq(""), any());
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionServiceParametersListWidgetTest method testLoadGroupElements.
@Test
public void testLoadGroupElements() {
final HTMLElement inputElement = mock(HTMLElement.class);
final HTMLElement outputElement = mock(HTMLElement.class);
final HTMLElement encapsulatedElement = mock(HTMLElement.class);
when(groupInputs.getElement()).thenReturn(inputElement);
when(groupOutputs.getElement()).thenReturn(outputElement);
when(groupEncapsulated.getElement()).thenReturn(encapsulatedElement);
final elemental2.dom.HTMLElement htmlInput = mock(elemental2.dom.HTMLElement.class);
final elemental2.dom.HTMLElement htmlOutput = mock(elemental2.dom.HTMLElement.class);
final elemental2.dom.HTMLElement htmlEncapsulated = mock(elemental2.dom.HTMLElement.class);
when(util.asHTMLElement(inputElement)).thenReturn(htmlInput);
when(util.asHTMLElement(outputElement)).thenReturn(htmlOutput);
when(util.asHTMLElement(encapsulatedElement)).thenReturn(htmlEncapsulated);
widget.loadGroupsElements();
verify(container).appendChild(htmlInput);
verify(container).appendChild(htmlOutput);
verify(container).appendChild(htmlEncapsulated);
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class ParameterGroupTest method testAddParameter.
@Test
public void testAddParameter() {
final String name = "name";
final String type = "type";
final HTMLElement htmlElement = mock(HTMLElement.class);
final ParameterItem parameterItem = mock(ParameterItem.class);
final elemental2.dom.HTMLElement element = mock(elemental2.dom.HTMLElement.class);
doReturn(parameterItem).when(parameterGroup).createParameterItem();
when(parameterItem.getElement()).thenReturn(htmlElement);
when(util.asHTMLElement(htmlElement)).thenReturn(element);
parameterGroup.addParameter(name, type);
verify(util).asHTMLElement(htmlElement);
verify(parameters).appendChild(element);
verify(parameterGroup).refreshNone();
assertFalse(parameterGroup.isEmpty());
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class NewPropertiesDisplayerViewIpml method showProperty.
@Override
public void showProperty(String property) {
HTMLElement strong = document.createElement("strong");
strong.setTextContent(property);
HTMLElement li = document.createElement("li");
li.appendChild(strong);
properties.appendChild(li);
}
Aggregations