use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class CommandUtilsTest method testUpdateParentInformation_WithMultipleColumns.
@Test
public void testUpdateParentInformation_WithMultipleColumns() {
setupUiModel(Pair.newPair(new ExpressionEditorColumn(gridLayer, new BaseHeaderMetaData("column"), gridWidget), (rowIndex) -> {
final BaseExpressionGrid grid = mock(BaseExpressionGrid.class);
final GridCellTuple gct = new GridCellTuple(rowIndex, 0, mock(GridWidget.class));
when(grid.getParentInformation()).thenReturn(gct);
return new ExpressionCellValue(Optional.of(grid));
}), Pair.newPair(new RowNumberColumn(), (rowIndex) -> new BaseGridCellValue<>(rowIndex + 1)));
assertParentInformationValues(0);
uiModel.moveColumnTo(0, uiModel.getColumns().get(1));
CommandUtils.updateParentInformation(uiModel);
assertParentInformationValues(1);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class ExpressionContainerUIModelMapperTest method assertEditorType.
private void assertEditorType(final Class<?> clazz) {
final GridCell<?> gridCell = uiModel.getCell(0, 0);
assertThat(gridCell).isNotNull();
assertThat(gridCell).isInstanceOf(ContextGridCell.class);
final GridCellValue<?> gridCellValue = gridCell.getValue();
assertThat(gridCellValue).isNotNull();
assertThat(gridCellValue).isInstanceOf(ExpressionCellValue.class);
final ExpressionCellValue ecv = (ExpressionCellValue) gridCellValue;
final Optional<BaseExpressionGrid> editor = ecv.getValue();
assertThat(editor.isPresent()).isTrue();
assertThat(editor.get()).isInstanceOf(clazz);
}
Aggregations