use of org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent in project kie-wb-common by kiegroup.
the class DMNDiagramEditorTest method testOnDataTypeEditModeToggleWhenEditModeIsNotEnabled.
@Test
public void testOnDataTypeEditModeToggleWhenEditModeIsNotEnabled() {
final DataTypeEditModeToggleEvent editModeToggleEvent = mock(DataTypeEditModeToggleEvent.class);
doNothing().when(diagramEditor).enableMenuItem(any());
when(editModeToggleEvent.isEditModeEnabled()).thenReturn(false);
diagramEditor.getOnDataTypeEditModeToggleCallback(editModeToggleEvent).onInvoke();
verify(diagramEditor).enableMenuItem(MenuItems.SAVE);
}
use of org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent in project kie-wb-common by kiegroup.
the class DMNDiagramEditorTest method testOnDataTypeEditModeToggleWhenEditModeIsEnabled.
@Test
public void testOnDataTypeEditModeToggleWhenEditModeIsEnabled() {
final DataTypeEditModeToggleEvent editModeToggleEvent = mock(DataTypeEditModeToggleEvent.class);
doNothing().when(diagramEditor).disableMenuItem(any());
when(editModeToggleEvent.isEditModeEnabled()).thenReturn(true);
diagramEditor.getOnDataTypeEditModeToggleCallback(editModeToggleEvent).onInvoke();
verify(diagramEditor).disableMenuItem(MenuItems.SAVE);
}
use of org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent in project kie-wb-common by kiegroup.
the class DataTypeListTest method testOnDataTypeEditModeToggleStartEditing.
@Test
public void testOnDataTypeEditModeToggleStartEditing() {
final DataTypeListItem currentEditingItem = mock(DataTypeListItem.class);
final DataTypeEditModeToggleEvent event = new DataTypeEditModeToggleEvent(true, currentEditingItem);
dataTypeList.onDataTypeEditModeToggle(event);
final DataTypeListItem actual = dataTypeList.getCurrentEditingItem();
verify(searchBar).reset();
assertEquals(currentEditingItem, actual);
}
use of org.kie.workbench.common.dmn.client.editors.types.listview.common.DataTypeEditModeToggleEvent in project kie-wb-common by kiegroup.
the class DataTypeListTest method testOnDataTypeEditModeToggleStopEditing.
@Test
public void testOnDataTypeEditModeToggleStopEditing() {
final DataTypeListItem currentEditingItem = mock(DataTypeListItem.class);
final DataTypeEditModeToggleEvent event = new DataTypeEditModeToggleEvent(false, currentEditingItem);
dataTypeList.onDataTypeEditModeToggle(event);
final DataTypeListItem actual = dataTypeList.getCurrentEditingItem();
verify(searchBar).reset();
assertEquals(null, actual);
}
Aggregations