use of org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent in project kie-wb-common by kiegroup.
the class DataTypeSelectViewTest method testOnSelectChangeWhenTheSameValueIsSet.
@Test
public void testOnSelectChangeWhenTheSameValueIsSet() {
final JQuerySelectPickerEvent event = mock(JQuerySelectPickerEvent.class);
final JQuerySelectPickerTarget target = mock(JQuerySelectPickerTarget.class);
final String newValue = "value";
final String oldValue = "value";
doNothing().when(view).setPickerValue(newValue);
doReturn(oldValue).when(view).getValue();
event.target = target;
target.value = newValue;
view.onSelectChange(event);
verify(view, never()).setPickerValue(newValue);
verify(presenter, never()).clearDataTypesList();
}
use of org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent in project kie-wb-common by kiegroup.
the class DataTypeSelectViewTest method testOnSelectChangeWhenOtherValueIsSet.
@Test
public void testOnSelectChangeWhenOtherValueIsSet() {
final JQuerySelectPickerEvent event = mock(JQuerySelectPickerEvent.class);
final JQuerySelectPickerTarget target = mock(JQuerySelectPickerTarget.class);
final String newValue = "newValue";
final String oldValue = "oldValue";
doNothing().when(view).setPickerValue(newValue);
doReturn(oldValue).when(view).getValue();
event.target = target;
target.value = newValue;
view.onSelectChange(event);
verify(view).setPickerValue(newValue);
verify(presenter).clearDataTypesList();
}
use of org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent in project kie-wb-common by kiegroup.
the class DataTypeConstraintModalViewTest method testOnSelectChangeWhenValueIsNotBlank.
@Test
public void testOnSelectChangeWhenValueIsNotBlank() {
final JQuerySelectPickerEvent jQueryEvent = mock(JQuerySelectPickerEvent.class);
final JQuerySelectPickerTarget pickerTarget = mock(JQuerySelectPickerTarget.class);
final ConstraintType constraintType = ENUMERATION;
doNothing().when(view).loadComponent(ENUMERATION);
jQueryEvent.target = pickerTarget;
pickerTarget.value = constraintType.value();
view.onSelectChange(jQueryEvent);
verify(view).loadComponent(constraintType);
}
use of org.uberfire.client.views.pfly.selectpicker.JQuerySelectPickerEvent in project kie-wb-common by kiegroup.
the class KieAssetsDropdownViewTest method onDropdownChangeHandlerMethod.
@Test
public void onDropdownChangeHandlerMethod() {
JQuerySelectPickerTarget targetMock = mock(JQuerySelectPickerTarget.class);
targetMock.value = DEFAULT_VALUE;
JQuerySelectPickerEvent eventMock = mock(JQuerySelectPickerEvent.class);
eventMock.target = targetMock;
kieAssetsDropdownView.onDropdownChangeHandlerMethod(eventMock);
verify(presenterMock, times(1)).onValueChanged();
}
Aggregations