Search in sources :

Example 1 with IntegerSliderDefinition

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());
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) IntegerSliderDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition) Test(org.junit.Test)

Example 2 with IntegerSliderDefinition

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());
}
Also used : DoubleSliderDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.DoubleSliderDefinition) DatePickerFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition) CheckBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition) StringListBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.StringListBoxFieldDefinition) TextAreaFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition) EnumListBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.EnumListBoxFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) DecimalBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.decimalBox.definition.DecimalBoxFieldDefinition) StringRadioGroupFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.radioGroup.definition.StringRadioGroupFieldDefinition) SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) TextBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition) IntegerSliderDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition) IntegerBoxFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.integerBox.definition.IntegerBoxFieldDefinition) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 IntegerSliderDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.IntegerSliderDefinition)2 CheckBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition)1 DatePickerFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.datePicker.definition.DatePickerFieldDefinition)1 DecimalBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.decimalBox.definition.DecimalBoxFieldDefinition)1 IntegerBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.integerBox.definition.IntegerBoxFieldDefinition)1 EnumListBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.EnumListBoxFieldDefinition)1 StringListBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.listBox.definition.StringListBoxFieldDefinition)1 StringRadioGroupFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.selectors.radioGroup.definition.StringRadioGroupFieldDefinition)1 DoubleSliderDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.slider.definition.DoubleSliderDefinition)1 TextAreaFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textArea.definition.TextAreaFieldDefinition)1 TextBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition)1 MultipleSubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition)1 SubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition)1 Mockito.anyString (org.mockito.Mockito.anyString)1