use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition in project kie-wb-common by kiegroup.
the class FormEditorHelperTest method testGetCompatibleModelFields.
@Test
public void testGetCompatibleModelFields() {
List<String> compatibleModelFields = formEditorHelper.getCompatibleModelFields(nameField);
Assertions.assertThat(compatibleModelFields).hasSize(2).contains(lastNameField.getId(), nameField.getId());
// Getting compatible model propertynames for an integerbox field -> only checks integer properties (age -> integer)
compatibleModelFields = formEditorHelper.getCompatibleModelFields(ageField);
Assertions.assertThat(compatibleModelFields).containsOnly(ageField.getId());
// Getting compatible model propertynames for an decimalbox field -> only checks decimal properties (weight -> double)
compatibleModelFields = formEditorHelper.getCompatibleModelFields(weightField);
Assertions.assertThat(compatibleModelFields).hasSize(1).containsOnly(weightField.getId());
IntegerSliderDefinition slider = new IntegerSliderDefinition();
slider.setId("slider");
slider.setName("slider");
slider.setLabel("slider");
slider.setBinding("slider");
// Getting compatible model propertynames for an integer slider field -> slider's are available for integer properties (age -> integer)
compatibleModelFields = formEditorHelper.getCompatibleModelFields(slider);
Assertions.assertThat(compatibleModelFields).hasSize(1).containsOnly(ageField.getId());
}
use of org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition in project kie-wb-common by kiegroup.
the class FieldRendererManagerImplTest method testFunctionallity.
@Test
public void testFunctionallity() {
testRendererFor(new CheckBoxFieldDefinition());
testRendererFor(new DatePickerFieldDefinition());
testRendererFor(new EnumListBoxFieldDefinition());
testRendererFor(new StringListBoxFieldDefinition());
testRendererFor(new StringRadioGroupFieldDefinition());
testRendererFor(new TextAreaFieldDefinition());
testRendererFor(new IntegerSliderDefinition());
testRendererFor(new DoubleSliderDefinition());
testRendererFor(new MultipleSubFormFieldDefinition());
testRendererFor(new SubFormFieldDefinition());
testRendererFor(new TextBoxFieldDefinition());
testRendererFor(new DecimalBoxFieldDefinition());
testRendererFor(new IntegerBoxFieldDefinition());
}
Aggregations