use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class UndefinedExpressionGridTest method testSelectFirstCellWhenNotNested.
@Test
public void testSelectFirstCellWhenNotNested() {
setupGrid(0);
final Decision decision = mock(Decision.class);
when(hasExpression.asDMNModelInstrumentedBase()).thenReturn(decision);
grid.selectFirstCell();
final List<GridData.SelectedCell> selectedCells = grid.getModel().getSelectedCells();
assertThat(selectedCells.size()).isEqualTo(1);
assertThat(selectedCells.get(0).getRowIndex()).isEqualTo(0);
assertThat(selectedCells.get(0).getColumnIndex()).isEqualTo(0);
verify(gridLayer).select(grid);
verify(domainObjectSelectionEvent).fire(domainObjectSelectionArgumentEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionArgumentEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(decision);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class UndefinedExpressionGridTest method testOnExpressionTypeChangedWhenNotNested.
@Test
@SuppressWarnings("unchecked")
public void testOnExpressionTypeChangedWhenNotNested() {
final Decision decision = mock(Decision.class);
when(hasExpression.asDMNModelInstrumentedBase()).thenReturn(decision);
assertOnExpressionTypeChanged(0);
verify(expressionGridCache).getExpressionGrid(eq(NODE_UUID));
verify(domainObjectSelectionEvent).fire(domainObjectSelectionArgumentEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionArgumentEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(decision);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class ListGridTest method assertDomainObjectSelection.
private void assertDomainObjectSelection(final Expression domainObject) {
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(domainObject);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class RelationGridTest method testSelectHeaderExpression.
@Test
public void testSelectHeaderExpression() {
setupGrid(0);
grid.selectHeaderCell(0, RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT, false, false);
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(expression.get().getColumn().get(0));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class RelationGridTest method testSelectRow.
@Test
public void testSelectRow() {
setupGrid(0);
grid.selectCell(0, 0, false, false);
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isInstanceOf(NOPDomainObject.class);
}
Aggregations