use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class DataTypeSelectViewTest method testMakeOption.
@Test
public void testMakeOption() {
final String value = "value";
final DataType dataType = makeDataType(value);
final HTMLOptionElement htmlOptionElement = mock(HTMLOptionElement.class);
doReturn(htmlOptionElement).when(view).makeHTMLOptionElement();
final HTMLOptionElement option = view.makeOption(dataType, DataType::getName);
assertEquals(value, option.text);
assertEquals(value, option.value);
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorView method createOptionWithOffset.
HTMLOptionElement createOptionWithOffset(final String timeZoneOffSet) {
final HTMLOptionElement option = getNewOption();
option.value = timeZoneOffSet;
option.text = timeZoneOffSet;
return option;
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class DataTypeSelectView method makeOption.
HTMLOptionElement makeOption(final DataType dataType, final Function<DataType, String> dataTypeConsumer) {
final String optionValue = dataTypeConsumer.apply(dataType);
final HTMLOptionElement option = makeHTMLOptionElement();
option.text = optionValue;
option.value = optionValue;
return option;
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class DataTypeSelectView method makeOptionGroup.
HTMLOptGroupElement makeOptionGroup(final String groupTitle, final List<DataType> dataTypes, final Function<DataType, String> dataTypeConsumer) {
final HTMLOptGroupElement optionGroup = makeHTMLOptGroupElement();
optionGroup.label = groupTitle;
dataTypes.stream().forEach(dataType -> {
final HTMLOptionElement option = makeOption(dataType, dataTypeConsumer);
optionGroup.appendChild(option);
});
return optionGroup;
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorViewTest method testReloadTimeZoneSelectorIsNotOffsetMode.
@Test
public void testReloadTimeZoneSelectorIsNotOffsetMode() {
final HTMLOptionElement none = mock(HTMLOptionElement.class);
doReturn(none).when(view).createNoneOption();
doReturn(false).when(view).getIsOffsetMode();
view.reloadTimeZoneSelector();
verify(view, never()).populateTimeZoneSelectorWithOffSets();
verify(view).populateTimeZoneSelectorWithIds();
}
Aggregations