use of org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testSetOnClosedByKeyboardCallback.
@Test
public void testSetOnClosedByKeyboardCallback() {
final PopupEditorControls editor = mock(PopupEditorControls.class, withSettings().extraInterfaces(CanBeClosedByKeyboard.class));
view.setOnClosedByKeyboardCallback(editor);
verify((CanBeClosedByKeyboard) editor).setOnClosedByKeyboardCallback(any());
}
use of org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testRemoveOnClosedByKeyboardCallback.
@Test
public void testRemoveOnClosedByKeyboardCallback() {
final PopupEditorControls editor = mock(PopupEditorControls.class, withSettings().extraInterfaces(CanBeClosedByKeyboard.class));
view.removeOnClosedByKeyboardCallback(editor);
verify((CanBeClosedByKeyboard) editor).setOnClosedByKeyboardCallback(null);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testHide.
@Test
public void testHide() {
final PopupEditorControls editor = mock(PopupEditorControls.class);
final Optional<PopupEditorControls> activeEditor = Optional.of(editor);
doReturn(activeEditor).when(view).getActiveEditor();
view.hide();
verify(editor).hide();
verify(view).removeOnClosedByKeyboardCallback(editor);
verify(view).setActiveEditor(Optional.empty());
}
use of org.kie.workbench.common.dmn.client.widgets.grid.controls.PopupEditorControls in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testShow.
@Test
public void testShow() {
final PopupEditorControls editor = mock(PopupEditorControls.class);
final int x = 10;
final int y = 20;
final HTMLElement element = mock(HTMLElement.class);
doReturn(element).when(view).getElement();
final CSSStyleDeclaration style = mock(CSSStyleDeclaration.class);
when(element.getStyle()).thenReturn(style);
view.show(editor, x, y);
verify(style).setProperty(LEFT, x + PX);
verify(style).setProperty(TOP, y + PX);
verify(view).setOnClosedByKeyboardCallback(editor);
verify(editor).show();
}
Aggregations