use of org.linkki.core.binding.TestEnum in project linkki by linkki-framework.
the class UIComboBoxIntegrationTest method testNullSelection.
@Test
public void testNullSelection() {
assertThat(getStaticComponent().isNullSelectionAllowed(), is(false));
List<TestEnum> availableValues = new ArrayList<>(getDefaultPmo().getValueAvailableValues());
ComboBox comboBox = getDynamicComponent();
assertThat(availableValues.contains(null), is(false));
assertThat(comboBox.isNullSelectionAllowed(), is(false));
availableValues.add(null);
assertThat(availableValues.contains(null), is(true));
getDefaultPmo().setValueAvailableValues(availableValues);
updateUi();
assertThat(comboBox.getItemIds(), contains(TestEnum.ONE, TestEnum.TWO, TestEnum.THREE, comboBox.getNullSelectionItemId()));
}
use of org.linkki.core.binding.TestEnum in project linkki by linkki-framework.
the class UISubsetChooserTest method testAddObjectToRightLineAndRemoveItAgain.
@Test
public void testAddObjectToRightLineAndRemoveItAgain() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
Map<String, Object> variables = new HashMap<>();
variables.put("selected", new String[] { "1" });
subsetChooser.changeVariables(null, variables);
@SuppressWarnings("unchecked") Set<TestEnum> selectedValuesResult = (Set<TestEnum>) subsetChooser.getValue();
assertThat(selectedValuesResult, containsInAnyOrder(TestEnum.ONE));
variables.put("selected", new String[] {});
subsetChooser.changeVariables(null, variables);
@SuppressWarnings("unchecked") Set<TestEnum> selectedValuesResultEmpty = (Set<TestEnum>) subsetChooser.getValue();
assertThat(selectedValuesResultEmpty, empty());
}
Aggregations