use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementUpdatedEvent in project kie-wb-common by kiegroup.
the class ExpressionEditorTest method testOnCanvasElementUpdatedDifferentNode.
@Test
@SuppressWarnings("unchecked")
public void testOnCanvasElementUpdatedDifferentNode() {
final CanvasElementUpdatedEvent event = new CanvasElementUpdatedEvent(canvasHandler, node);
final Decision differentNodeDefinition = mock(Decision.class);
when(node.getContent()).thenReturn(definition);
when(definition.getDefinition()).thenReturn(differentNodeDefinition);
setupExpression(decision, decision, toolbarStateHandler, false);
testedEditor.handleCanvasElementUpdated(event);
verify(view, never()).setExpressionNameText(any(Optional.class));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementUpdatedEvent in project kie-wb-common by kiegroup.
the class ExpressionEditorControlImplTest method testOnCanvasElementUpdated.
@Test
public void testOnCanvasElementUpdated() {
control.bind(session);
final CanvasElementUpdatedEvent event = new CanvasElementUpdatedEvent(canvasHandler, node);
control.onCanvasElementUpdated(event);
verify(editor).handleCanvasElementUpdated(event);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementUpdatedEvent in project kie-wb-common by kiegroup.
the class ExpressionEditorTest method testOnCanvasElementUpdatedDefinitions.
@Test
public void testOnCanvasElementUpdatedDefinitions() {
final CanvasElementUpdatedEvent event = new CanvasElementUpdatedEvent(canvasHandler, node);
final String NEW_DRG_NAME = "new-drg-name";
when(node.getContent()).thenReturn(definition);
when(definition.getDefinition()).thenReturn(definitions);
when(dmnDiagramsSession.isGlobalGraphSelected()).thenReturn(true);
setupExpression(decision, decision, toolbarStateHandler, false);
verify(view).setReturnToLinkText(eq(DRG_NAME));
this.definitions.getName().setValue(NEW_DRG_NAME);
testedEditor.handleCanvasElementUpdated(event);
verify(view).setReturnToLinkText(eq(NEW_DRG_NAME));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementUpdatedEvent in project kie-wb-common by kiegroup.
the class TreeExplorerTest method testOnElementUpdated_childHighlighted.
@Test
public void testOnElementUpdated_childHighlighted() {
final Node parent = mock(Node.class);
when(parent.getUUID()).thenReturn("PARENT_UUID");
when(parent.getContent()).thenReturn(mock(View.class));
final Node child = mock(Node.class);
when(child.getUUID()).thenReturn("CHILD_UUID");
when(child.getContent()).thenReturn(mock(View.class));
final Edge edge = mock(Edge.class);
when(edge.getSourceNode()).thenReturn(parent);
when(edge.getTargetNode()).thenReturn(child);
when(edge.getContent()).thenReturn(mock(Child.class));
final List<Edge> edges = Collections.singletonList(edge);
when(parent.getOutEdges()).thenReturn(edges);
when(child.getInEdges()).thenReturn(edges);
when(view.isItemChanged(anyString(), anyString(), anyString(), anyInt(), any(OptionalInt.class))).thenReturn(true);
testedTree.show(canvasHandler);
final CanvasElementUpdatedEvent event = new CanvasElementUpdatedEvent(canvasHandler, child);
testedTree.onCanvasElementUpdatedEvent(event);
verify(view, times(1)).setSelectedItem(eq("CHILD_UUID"));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.registration.CanvasElementUpdatedEvent in project kie-wb-common by kiegroup.
the class DecisionNavigatorObserverTest method testOnCanvasElementUpdated.
@Test
public void testOnCanvasElementUpdated() {
observer.init(presenter);
observer.onCanvasElementUpdated(new CanvasElementUpdatedEvent(canvasHandler, element));
verify(presenter).refresh();
}
Aggregations